Re: [HACKERS] conditional dropping of columns/constraints

2009-07-19 Thread Andrew Dunstan
Bernd Helmle wrote: Here is a slightly updated version of the patch. I did some (very minor) editing on the wording in the docs and cleaned a merge conflict in tablecmds.c. I saw no code issues so far, make check passes without errors. Maybe someone with more bison skills can comment on

Re: [HACKERS] conditional dropping of columns/constraints

2009-07-09 Thread Bernd Helmle
--On Donnerstag, Mai 07, 2009 12:57:56 +0200 Andres Freund and...@anarazel.de wrote: Ok, fixed that place (stupid me, I had seen that it is used there and forgot about it) and found no other places. Thanks, Andres Here is a slightly updated version of the patch. I did some (very minor)

Re: [HACKERS] conditional dropping of columns/constraints

2009-05-07 Thread Andres Freund
Hi Tom, hi all, On 05/06/2009 11:43 PM, Tom Lane wrote: Andres Freundand...@anarazel.de writes: As this is my first patch to PG I am happy with most sort of feedback. Please add your patch to the commit-fest queue here: http://wiki.postgresql.org/wiki/CommitFestInProgress Will do so, after

Re: [HACKERS] conditional dropping of columns/constraints

2009-05-06 Thread Andres Freund
Hi, On 05/04/2009 04:10 PM, Andres Freund wrote: Would a patch adding 'IF EXISTS' support to: - ALTER TABLE ... DROP COLUMN - ALTER TABLE ... DROP CONSTRAINT possibly be accepted? A first version of a patch is attached: - allows [ IF EXISTS ] for both, conditional dropping of columns and

Re: [HACKERS] conditional dropping of columns/constraints

2009-05-06 Thread Tom Lane
Andres Freund and...@anarazel.de writes: As this is my first patch to PG I am happy with most sort of feedback. Please add your patch to the commit-fest queue here: http://wiki.postgresql.org/wiki/CommitFestInProgress Since we are still busy with 8.4 beta, it's unlikely that anyone will take a

Re: [HACKERS] conditional dropping of columns/constraints

2009-05-05 Thread Chris Browne
robertmh...@gmail.com (Robert Haas) writes: On Mon, May 4, 2009 at 10:10 AM, Andres Freund and...@anarazel.de wrote: Would a patch adding 'IF EXISTS' support to: - ALTER TABLE ... DROP COLUMN - ALTER TABLE ... DROP CONSTRAINT possibly be accepted? Having it makes the annoying task of

Re: [HACKERS] conditional dropping of columns/constraints

2009-05-05 Thread Peter Eisentraut
On Monday 04 May 2009 22:21:10 Chris Browne wrote: For constraints, it's easy enough to treat that as idempotent; it's no big deal to drop and re-add a constraint. Not if the constraint is a primary key, for example. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To

Re: [HACKERS] conditional dropping of columns/constraints

2009-05-05 Thread Andrew Dunstan
Chris Browne wrote: For columns, I'd *much* more frequently be interested in ALTER TABLE ... ADD COLUMN IF NOT EXISTS ... We have debated CREATE ... IF NOT EXISTS in the past, and there is no consensus on what it should do, so we don't have it for any command. That is quite a

Re: [HACKERS] conditional dropping of columns/constraints

2009-05-05 Thread Andres Freund
Hi Chris, On 05/04/2009 09:21 PM, Chris Browne wrote: robertmh...@gmail.com (Robert Haas) writes: On Mon, May 4, 2009 at 10:10 AM, Andres Freundand...@anarazel.de wrote: Would a patch adding 'IF EXISTS' support to: - ALTER TABLE ... DROP COLUMN - ALTER TABLE ... DROP CONSTRAINT possibly be

Re: [HACKERS] conditional dropping of columns/constraints

2009-05-05 Thread Robert Haas
On Tue, May 5, 2009 at 8:56 AM, Andrew Dunstan and...@dunslane.net wrote: We have debated CREATE ... IF NOT EXISTS in the past, and there is no consensus on what it should do, so we don't have it for any command. That is quite a different case from what's being asked for, and the two should not

Re: [HACKERS] conditional dropping of columns/constraints

2009-05-05 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Tue, May 5, 2009 at 8:56 AM, Andrew Dunstan and...@dunslane.net wrote: We have debated CREATE ... IF NOT EXISTS in the past, and there is no consensus on what it should do, so we don't have it for any command. That is quite a different case from

Re: [HACKERS] conditional dropping of columns/constraints

2009-05-05 Thread Andrew Dunstan
Robert Haas wrote: On Tue, May 5, 2009 at 8:56 AM, Andrew Dunstan and...@dunslane.net wrote: We have debated CREATE ... IF NOT EXISTS in the past, and there is no consensus on what it should do, so we don't have it for any command. That is quite a different case from what's being asked

Re: [HACKERS] conditional dropping of columns/constraints

2009-05-04 Thread Andres Freund
On 05/04/2009 04:10 PM, Andres Freund wrote: Would a patch adding 'IF EXISTS' support to: - ALTER TABLE ... DROP COLUMN - ALTER TABLE ... DROP CONSTRAINT possibly be accepted? Having it makes the annoying task of writing/testing of schema-upgrade scripts a bit easier. Oh, and to any other

[HACKERS] conditional dropping of columns/constraints

2009-05-04 Thread Andres Freund
Hi, Would a patch adding 'IF EXISTS' support to: - ALTER TABLE ... DROP COLUMN - ALTER TABLE ... DROP CONSTRAINT possibly be accepted? Having it makes the annoying task of writing/testing of schema-upgrade scripts a bit easier. Andres -- Sent via pgsql-hackers mailing list

Re: [HACKERS] conditional dropping of columns/constraints

2009-05-04 Thread Robert Haas
On Mon, May 4, 2009 at 10:10 AM, Andres Freund and...@anarazel.de wrote: Would a patch adding 'IF EXISTS' support to: - ALTER TABLE ... DROP COLUMN - ALTER TABLE ... DROP CONSTRAINT possibly be accepted? Having it makes the annoying task of writing/testing of schema-upgrade scripts a bit