DROP CONSTRAINT IF EXISTS

Started by Nonameover 15 years ago2 messagesbugs
Jump to latest
#1Noname
william.a.dean@gdc4s.com

The sql statement 'ALTER TABLE <table name> DROP CONSTRAINT IF EXISTS
<constraint-name>' returns with a syntax error on exists. The
documentation states that the IF EXISTS clause is allowed in DROP
CONSTRAINT statements.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Noname (#1)
Re: DROP CONSTRAINT IF EXISTS

<william.a.dean@gdc4s.com> writes:

The sql statement 'ALTER TABLE <table name> DROP CONSTRAINT IF EXISTS
<constraint-name>' returns with a syntax error on exists. The
documentation states that the IF EXISTS clause is allowed in DROP
CONSTRAINT statements.

Apparently you're reading 9.0 documentation and using a pre-9.0 server.
Please see the manual appropriate to your PG version.

regards, tom lane