Re: conditional alter table

From: Chris <dmagick(at)gmail(dot)com>
To: Brian Cox <brian(dot)cox(at)ca(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: conditional alter table
Date: 2008-06-02 00:37:20
Message-ID: 484340C0.6020507@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Brian Cox wrote:
> I'd like to either 1) execute an alter table to re-add a constraint only
> if it doesn't exist or 2) have psql ignore the failure when setting it's
> exit status. Any ideas on how to do either would be appreciated.

I don't think there's a way to do that but you can look at the
pg_constraint table to see if it exists.

http://www.postgresql.org/docs/current/static/catalog-pg-constraint.html
--
Postgresql & php tutorials
http://www.designmagick.com/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2008-06-02 02:41:37 Re: HELP with a query with blank fields
Previous Message Chris 2008-06-02 00:34:56 Re: phpeclipse debugging & setup