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 72AFC53696 for ; Thu, 7 Apr 2005 20:49:02 +0100 (BST) 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 87617-07 for ; Thu, 7 Apr 2005 19:48:52 +0000 (GMT) Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3A8FD53205 for ; Thu, 7 Apr 2005 20:48:51 +0100 (BST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id C34DA30952; Thu, 7 Apr 2005 21:48:27 +0200 (MET DST) From: Jeff Boes X-Newsgroups: pgsql.sql Subject: Re: DROP TYPE without error? Date: Thu, 07 Apr 2005 15:48:49 -0400 Organization: Hub.Org Networking Services Lines: 31 Message-ID: References: <6C0CF58A187DA5479245E0830AF84F4208057C@poweredge.attiksystem.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en In-Reply-To: <6C0CF58A187DA5479245E0830AF84F4208057C@poweredge.attiksystem.ch> To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200504/81 X-Sequence-Number: 20974 Philippe Lang wrote: > Hi, > > Since it is not possible to use CREATE OR REPLACE TYPE, is there a way > of using DROP TYPE on a non-existing type, without causing the entire > script to abort? It may sound crazy to ask for this, but it could be > really useful in my case, where Pl/Pgsql and Pl/Perl code is being > generated automatically, based on data found in a database. > If I understand you correctly, then this might be useful: begin; select now(); \o tmp.tmp \qecho 'drop type \"foofookitty\";' \o \! psql -f tmp.tmp select now(); commit; -- Jeff Boes Vox 269-226-9550 x24 Director of Software Development Fax 269-349-9076 Exfacto! Exceptional Online Content http://www.exfacto.com Nexcerpt ...Extend Your Expertise... http://www.nexcerpt.com