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