Re: How to change primary key in a table - Mailing list pgsql-novice

From Tom Lane
Subject Re: How to change primary key in a table
Date
Msg-id 24459.1258038957@sss.pgh.pa.us
Whole thread Raw
In response to How to change primary key in a table  (Rikard Bosnjakovic <rikard.bosnjakovic@gmail.com>)
Responses using position in where  ("Lynn Manhart" <ManhartL@mstarmetro.net>)
List pgsql-novice
Rikard Bosnjakovic <rikard.bosnjakovic@gmail.com> writes:
> I tried this:

> ========================================
> SQL error:
> ERROR:  cannot drop constraint penalty_codes_pkey on table
> penalty_codes because other objects depend on it
> HINT:  Use DROP ... CASCADE to drop the dependent objects too.

> In statement:
> ALTER TABLE "penalty_codes" DROP CONSTRAINT "penalty_codes_pkey"
> ========================================

The system will normally tell you exactly what depends on the
constraint.  8.4 includes this in a DETAIL line, but prior releases
spit it out as separate NOTICE message(s).  I surmise that you are
running a pre-8.4 release and you have client_min_messages set to
suppress NOTICEs :-(

(Offhand I can't think of anything except foreign keys that would
depend on a PK constraint, but you may as well get the authoritative
statement from your DB.)

            regards, tom lane

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: CRC protection of data?
Next
From: "Lynn Manhart"
Date:
Subject: using position in where