<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div>For a) and b), I would try playing around with $dbh->err() and $dbh->errstr() to get the NOTICE message, and to disable it, try setting PrintError to false in your connection string.<div><br></div><div>For c), I've had to do that sort of thing before (as well as analyze indexes for table partitioning), so here's the code to do that. &nbsp;Just change the c.relname=lower('your_table_name') and the lower(n.nspname) is the schema.<br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><font class="Apple-style-span" face="Arial"><br class="Apple-interchange-newline"><div><div>&nbsp;&nbsp;SELECT i.conname, pg_catalog.pg_get_constraintdef(i.oid) as ddl</div><div>&nbsp;&nbsp; &nbsp; &nbsp; FROM pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_constraint i</div><div>&nbsp;&nbsp; &nbsp; &nbsp; WHERE c.oid = (SELECT &nbsp;distinct c.oid</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FROM pg_class c INNER JOIN pg_namespace n ON c.relnamespace = n.oid</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WHERE c.relkind = 'r'</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AND c.relname = lower('emails')</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AND lower(n.nspname) = lower('spamdb')</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; AND c.oid = i.conrelid AND i.conrelid = c2.oid</div><div>&nbsp;&nbsp; &nbsp; &nbsp; AND i.contype !='c'</div><div>&nbsp;&nbsp; &nbsp; &nbsp; ORDER BY i.contype desc;</div><div><br></div><div>Hope that helps.</div><div><br></div><div>-Don</div><div><br></div></div></font></div><div><font class="Apple-style-span" face="Arial">--</font></div><div><font class="Apple-style-span" face="Arial">Don Drake</font></div><div><font class="Apple-style-span" face="Arial"><a href="http://www.drakeconsulting.com">www.drakeconsulting.com</a></font></div><div><font class="Apple-style-span" face="Arial"><a href="http://www.maillaunder.com">www.maillaunder.com</a></font></div><div><font class="Apple-style-span" face="Arial">312-560-1574</font></div><div><font class="Apple-style-span" face="Arial">800-733-2143</font></div></div></div></span></div></span></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline"></div></span> </div><br><div><div>On Mar 23, 2009, at 9:36 PM, Michael Potter wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Chicago Perl Crew,<br><br>When I do this :<br> &nbsp;&nbsp;$sql = qq{ DROP TABLE "terminalXgroup" CASCADE };<br> &nbsp;&nbsp;$dbh->do($sql);<br><br>I get this message:<br>NOTICE: &nbsp;drop cascades to constraint terminalXgroup_group_fkey on<br>table "terminalXgroup"<br><br>a) What are the ways to suppress this message?<br>b) Is there a convenient way to capture this message in a variable<br>rather than letting it go to the terminal?<br>c) Is there a way to drop all constraints on a table without knowing<br>their names?<br><br>for c) I could drop the constraints before I drop the table; that way<br>the notice message would not be active. &nbsp;I know how to drop a single<br>constraint by name, but I can not find how to get the list of<br>constraints in postgres.<br><br>My goal is the drop a set of tables and not have a bunch of messages<br>come out that I do not care about. &nbsp;Even if I do a) or b) I think I<br>still want to do c).<br><br>I am not willing to name all my constraints; I think I would rather<br>live with the notice messages.<br><br>-- <br>Michael Potter<br>_______________________________________________<br>Chicago-talk mailing list<br><a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br>http://mail.pm.org/mailman/listinfo/chicago-talk<br></div></blockquote></div><br></div></body></html>