Re: ALTER TABLE ... IF EXISTS feature?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Farina <drfarina(at)acm(dot)org>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ALTER TABLE ... IF EXISTS feature?
Date: 2010-11-05 18:04:15
Message-ID: 27481.1288980255@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Daniel Farina <drfarina(at)acm(dot)org> writes:
> I am somewhat sympathetic to this argument, except for one thing:

> pg_dump --clean will successfully and silently wipe out a foreign key
> right now, should it exist,

No, it will not, because we don't use CASCADE in the drop commands.

The case I'm thinking about is where we are trying to --clean the PK
table, and the referencing table is one we don't know about. The other
way around, the FK constraint will disappear, but that's arguably less
problematic.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-11-05 18:13:47 Re: [PATCH] Revert default wal_sync_method to fdatasync on Linux 2.6.33+
Previous Message Daniel Farina 2010-11-05 17:36:38 Re: ALTER TABLE ... IF EXISTS feature?