Skip site navigation (1) Skip section navigation (2)

Re: Syntax error in DROP CONSTRAINT

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Rajan Bhide <rbhide(at)starentnetworks(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org,Ritesh Kumar Kakar <rkakar(at)starentnetworks(dot)com>
Subject: Re: Syntax error in DROP CONSTRAINT
Date: 2004-11-17 14:46:07
Message-ID: 20041117064315.B17486@megazone.bigpanda.com (view raw or flat)
Thread:
Lists: pgsql-novice
On Wed, 17 Nov 2004, Rajan Bhide wrote:

> Hi Forum,
>
> I need to add a colume to existing composite primary key on a table.
> I tried using following:
> >> ALTER TABLE DROP CONSTRAINT tablename_pkey;
> >> ALTER TABLE ADD CONSTRAINT PRIMARY KEY (col1, col2, col3, new_col4);
>
> When I try this using Postgres 7.2.4 I get psql syntax error in DROP
> CONSTRAINT.
> ERROR:  parser: parse error at or near ";"

I believe 7.2 requires RESTRICT at the end and the online docs imply that
it won't remove primary keys in any case so you'll probably need to drop
the index that was created for the constraint instead of using DROP
CONSTRAINT.


In response to

pgsql-novice by date

Next:From: sarlav kumarDate: 2004-11-17 15:12:46
Subject: Re: upgrade from postgres 7.3.2
Previous:From: Vishal Kashyap @ [SaiHertz]Date: 2004-11-17 13:48:09
Subject: Re: upgrade from postgres 7.3.2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group