pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Boes <jboes@nexcerpt.com>
To: pgsql-sql@postgresql.org
Subject: Re: DROP TYPE without error?
Date: Thu, 07 Apr 2005 15:48:49 -0400
Message-ID: <d342r1$2nsi$1@news.hub.org> (raw)
In-Reply-To: <6C0CF58A187DA5479245E0830AF84F4208057C@poweredge.attiksystem.ch>
References: <6C0CF58A187DA5479245E0830AF84F4208057C@poweredge.attiksystem.ch>

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



view thread (5+ messages)  latest in thread

Message-ID: <d342r1$2nsi$1@news.hub.org>
Permalink:  ../d342r1$2nsi$1@news.hub.org/
Also on:    postgresql.org/message-id/d342r1$2nsi$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jboes@nexcerpt.com
  Subject: Re: DROP TYPE without error?
  In-Reply-To: <d342r1$2nsi$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox