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

Re: dropping a table constraint

From: "Lee Wu" <Lwu(at)mxlogic(dot)com>
To: "Jodi Kanter" <jkanter(at)virginia(dot)edu>,"Postgres Admin List" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: dropping a table constraint
Date: 2004-09-13 15:48:34
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
Did you try:


alter table file_info drop constraint "$1";



-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of Jodi Kanter
Sent: Monday, September 13, 2004 9:31 AM
To: Postgres Admin List
Subject: [ADMIN] dropping a table constraint


I needed to add a FK constraint to a table where one was forgotten. I
found an add constraint command and used it:

ALTER TABLE file_info add foreign key (al_fk) references

However, I wanted to name the constraint. It now looks like this:

$1 FOREIGN KEY (al_fk) REFERENCES arraylayout(al_pk) ON UPDATE NO ACTION

I have tried using the drop command so I could recreate it with a name
but the drop command is not working.
I am on version 7.3.4.

can anyone tell me what I am doing wrong? I could dump and restore the
entire db but do not want to if it's not necessary.


Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter(at)virginia(dot)edu <mailto:jkanter(at)virginia(dot)edu100> 


pgsql-admin by date

Next:From: Wim KerkhoffDate: 2004-09-14 02:30:34
Subject: pg_class / missing tables
Previous:From: Jodi KanterDate: 2004-09-13 15:30:50
Subject: dropping a table constraint

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