X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 490C652834 for ; Fri, 20 May 2005 14:15:15 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 32616-08 for ; Fri, 20 May 2005 17:15:02 +0000 (GMT) Received: from pimout7-ext.prodigy.net (pimout7-ext.prodigy.net [207.115.63.58]) by svr1.postgresql.org (Postfix) with ESMTP id 36A705286C for ; Fri, 20 May 2005 14:15:00 -0300 (ADT) X-ORBL: [69.177.163.214] Received: from [192.168.1.207] (214.adsl.snet.net [69.177.163.214] (may be forged)) by pimout7-ext.prodigy.net (8.12.10 milter /8.12.10) with ESMTP id j4KHFM3R222566 for ; Fri, 20 May 2005 13:15:23 -0400 Message-ID: <428E1CE2.2050605@kencast.com> Date: Fri, 20 May 2005 13:22:42 -0400 From: Wei Weng User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "'pgsql-sql@postgresql.org'" Subject: How do I quit in the middle of a SQL script? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.384 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/167 X-Sequence-Number: 21480 Say if I want to add a small snip of code in front of the sql script generated by the pg_dump, to check for something then if the condition doesn't match, the script terminates right away. (Without actually doing the restoring stuff that the following large chunk is supposed to do) Can I do that? And is it a good idea to add arbitrary code to the database dump sql script? Thanks! Wei