Re: DROP TYPE without error? - Mailing list pgsql-sql

From Jeff Boes
Subject Re: DROP TYPE without error?
Date
Msg-id d342r1$2nsi$1@news.hub.org
Whole thread Raw
In response to DROP TYPE without error?  ("Philippe Lang" <philippe.lang@attiksystem.ch>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: Ragnar Hafstað
Date:
Subject: Re: 9.17.5. Row-wise Comparison
Next
From: Carlos Moreno
Date:
Subject: Question on triggers and plpgsql