Re: How can I delete a primary or foreign key?

From: tibor <tiborh(at)mail(dot)datanet(dot)hu>
To: PostreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: How can I delete a primary or foreign key?
Date: 2004-02-20 17:22:36
Message-ID: 200402201822.36563@newid
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday 20 Feb 2004 18:08, you wrote:
> On Friday 20 February 2004 16:04, tibor wrote:
> > I forgot to mention that I have tried numerous variations.
> > The one quoted in the original mail was from "The Complete Reference"
>
> Which book is this?

SQL: The Complete Reference, McGraw-Hill/Osborne, 2nd Edition, 2002
(James G. Groff and Paul N. Weinberg)

>
> Look in the SQL Command reference - ALTER TABLE
>
> > series. I've also tried the one that the \h command suggests:
> >
> > ALTER TABLE PARENTS DROP CONSTRAINT FOREIGN KEY (TYPE) CASCADE;
>
> The \h says the same as the manuals:
> ALTER TABLE [ ONLY ] table [ * ]
> DROP CONSTRAINT constraint_name [ RESTRICT | CASCADE ]
>
> If you have a table called "mytab" and a foreign-key constraint called
> "myfkey" then you would use
>
> ALTER TABLE mytab DROP CONSTRAINT myfkey;
>
> If your constaint has a generated name like $1 then you'll want to quote it
> "$1"

Thanks.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2004-02-20 17:57:41 Re: PHP + Postgres: More than 1000 postmasters produce
Previous Message scott.marlowe 2004-02-20 17:21:53 Re: PHP + Postgres: More than 1000 postmasters produce