Re: [PATCHES] drop if exists remnainder (reprise)

2006-06-16 Thread Andrew Dunstan
Andrew Dunstan wrote: Here is an updated patch for the remaining cases of DROP objtype IF EXISTS ... as recently discussed on -hackers. The cases are: language, tablespace, trigger, rule, opclass, function, aggregate. operator, and cast. Regression tests and docs still to come. I

[PATCHES] drop if exists remnainder (reprise)

2006-06-10 Thread Andrew Dunstan
Here is an updated patch for the remaining cases of DROP objtype IF EXISTS ... as recently discussed on -hackers. The cases are: language, tablespace, trigger, rule, opclass, function, aggregate. operator, and cast. Regression tests and docs still to come. I wasn't quite sure how to

Re: [HACKERS] [PATCHES] drop if exists remainder

2006-06-08 Thread Andrew Dunstan
Josh Berkus wrote: Tom, What's the consensus on this? Nobody else has chimed in, so I'm inclined to do no more on the gounds of insufficient demand. Let's decide before too much bitrot occurs, though. +1 :) +1 We were talking about this on IRC, and I feel that if

Re: [HACKERS] [PATCHES] drop if exists remainder

2006-06-08 Thread David Fetter
On Thu, Jun 08, 2006 at 09:43:19AM -0400, Andrew Dunstan wrote: OK there does seem to be some demand for this, so I will rework the patch, and hope to get it done by feature freeze - it has bitrotted with 7 merge conflicts, including the grammar file, so I need to look carefully at that. Pity

Re: [HACKERS] [PATCHES] drop if exists remainder

2006-06-08 Thread Andrew Dunstan
David Fetter wrote: On Thu, Jun 08, 2006 at 09:43:19AM -0400, Andrew Dunstan wrote: OK there does seem to be some demand for this, so I will rework the patch, and hope to get it done by feature freeze - it has bitrotted with 7 merge conflicts, including the grammar file, so I need to look

Re: [HACKERS] [PATCHES] drop if exists remainder

2006-06-08 Thread Jim C. Nasby
On Thu, Jun 08, 2006 at 12:34:54PM -0400, Andrew Dunstan wrote: David Fetter wrote: On Thu, Jun 08, 2006 at 09:43:19AM -0400, Andrew Dunstan wrote: OK there does seem to be some demand for this, so I will rework the patch, and hope to get it done by feature freeze - it has bitrotted with

Re: [HACKERS] [PATCHES] drop if exists remainder

2006-06-08 Thread Andrew Dunstan
Jim C. Nasby wrote: Important as you are, one swallow does not make a summer. On the other hand, unless we want the lists filling up with a bunch of +1 posts, it's probably better to assume that unless someone objects a patch would be accepted. What happened was that Tom objected

Re: [PATCHES] drop if exists remainder

2006-06-07 Thread Robert Treat
On Saturday 04 March 2006 22:24, David Fetter wrote: On Fri, Mar 03, 2006 at 03:35:24PM -0500, Andrew Dunstan wrote: Bruce Momjian wrote: Christopher Kings-Lynne wrote: What's the consensus on this? Nobody else has chimed in, so I'm inclined to do no more on the gounds of insufficient

Re: [HACKERS] [PATCHES] drop if exists remainder

2006-06-07 Thread Josh Berkus
Tom, What's the consensus on this? Nobody else has chimed in, so I'm inclined to do no more on the gounds of insufficient demand. Let's decide before too much bitrot occurs, though. +1 :) +1 We were talking about this on IRC, and I feel that if we're going to do IF EXISTS for any

Re: [PATCHES] drop if exists remainder

2006-03-04 Thread David Fetter
On Fri, Mar 03, 2006 at 03:35:24PM -0500, Andrew Dunstan wrote: Bruce Momjian wrote: Christopher Kings-Lynne wrote: What's the consensus on this? Nobody else has chimed in, so I'm inclined to do no more on the gounds of insufficient demand. Let's decide before too much bitrot occurs,

Re: [PATCHES] drop if exists remainder

2006-03-03 Thread Andrew Dunstan
Bruce Momjian wrote: Christopher Kings-Lynne wrote: Here's a first draft patch for DROP ... IF EXISTS for the remaining cases, namely: LANGUAGE, TABLESPACE, TRIGGER OPERATOR CLASS, FUNCTION, AGGREGATE, OPERATOR, CAST and RULE. At what point does this stop being useful and

Re: [PATCHES] drop if exists remainder

2006-03-03 Thread Bruce Momjian
Andrew Dunstan wrote: Chris KL said it should be done for all on the grounds of consistency. But I will happily stop right now if that's not the general view - I'm only doing this to complete something I started. Well, my use-case was to be able to wrap pg_dump -c output in

Re: [PATCHES] drop if exists remainder

2006-02-06 Thread Christopher Kings-Lynne
Here's a first draft patch for DROP ... IF EXISTS for the remaining cases, namely: LANGUAGE, TABLESPACE, TRIGGER OPERATOR CLASS, FUNCTION, AGGREGATE, OPERATOR, CAST and RULE. At what point does this stop being useful and become mere bloat? The only case I can ever recall being actually

Re: [PATCHES] drop if exists remainder

2006-02-06 Thread Bruce Momjian
Christopher Kings-Lynne wrote: Here's a first draft patch for DROP ... IF EXISTS for the remaining cases, namely: LANGUAGE, TABLESPACE, TRIGGER OPERATOR CLASS, FUNCTION, AGGREGATE, OPERATOR, CAST and RULE. At what point does this stop being useful and become mere bloat? The only

Re: [PATCHES] drop if exists remainder

2006-02-05 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: Here's a first draft patch for DROP ... IF EXISTS for the remaining cases, namely: LANGUAGE, TABLESPACE, TRIGGER OPERATOR CLASS, FUNCTION, AGGREGATE, OPERATOR, CAST and RULE. At what point does this stop being useful and become mere bloat? The only

Re: [PATCHES] drop if exists remainder

2006-02-05 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan [EMAIL PROTECTED] writes: Here's a first draft patch for DROP ... IF EXISTS for the remaining cases, namely: LANGUAGE, TABLESPACE, TRIGGER OPERATOR CLASS, FUNCTION, AGGREGATE, OPERATOR, CAST and RULE. At what point does this stop being useful and

Re: [PATCHES] drop if exists remainder

2006-02-05 Thread Bruce Momjian
Andrew Dunstan wrote: Tom Lane wrote: Andrew Dunstan [EMAIL PROTECTED] writes: Here's a first draft patch for DROP ... IF EXISTS for the remaining cases, namely: LANGUAGE, TABLESPACE, TRIGGER OPERATOR CLASS, FUNCTION, AGGREGATE, OPERATOR, CAST and RULE. At what point

Re: [PATCHES] drop if exists remainder

2006-02-05 Thread Andrew Dunstan
Bruce Momjian wrote: However, I see CREATE ROLE doesn't have REPLACE functionality, so what is the logic of when we need IF EXISTS and when we don't? Perhaps they all should have it, and the REPLACE is just for objects you want to replace but keep existing linkage in place. That was my

Re: [PATCHES] drop if exists - first piece

2005-11-19 Thread Andrew Dunstan
Tom Lane wrote: New test seems reasonable. done. A few other minor comments: * The NOTICEs should probably not carry an ERRCODE; usually you just want a notice to go out with the default not an error SQLSTATE. done. * The Assert(missing_ok)s are a waste of code space --- if

Re: [PATCHES] drop if exists - first piece

2005-11-18 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: I will apply the attached patch tomorrow, barring objection. This covers drop if exists for the following objects: table view index sequence schema type domain conversion I have a simple test script as show below, but I am not sure where to put it

Re: [PATCHES] drop if exists

2005-11-17 Thread Andrew Dunstan
Christopher Kings-Lynne wrote: I think anything else will have to be done individually, although the pattern can be copied. Perhaps we should take bids on what should/should not be covered. Everything should be covered, otherwise it's just annoying for users... Well, that's arguably

Re: [PATCHES] drop if exists

2005-11-17 Thread Michael Glaesemann
On Nov 17, 2005, at 11:51 , Christopher Kings-Lynne wrote: Including objects that already have CREATE OR REPLACE? I assume so - CREATE OR REPLACE doesn't drop things - only creates or replaces them. Of course. Silly me :) Michael Glaesemann grzm myrealbox com

Re: [PATCHES] drop if exists

2005-11-17 Thread Christopher Kings-Lynne
If the consensus is to add this to all of them, then I propose to apply the patch I have (with a slight fix for an oversight in the case of domains, plus docs and tests) for the 8 cases and start working on the remaining 13 as time permits. To be honest, I have not even looked at those 13

Re: [PATCHES] drop if exists

2005-11-16 Thread Bruce Momjian
Removed from queue. Andrew is committing it. --- Andrew Dunstan wrote: OK, now it looks like this: andrew=# drop table blurflx; ERROR: table blurflx does not exist andrew=# drop table if exists blurflx; NOTICE:

Re: [PATCHES] drop if exists

2005-11-16 Thread Christopher Kings-Lynne
Will we get this functionality for ALL objects? Bruce Momjian wrote: Removed from queue. Andrew is committing it. --- Andrew Dunstan wrote: OK, now it looks like this: andrew=# drop table blurflx; ERROR: table

Re: [PATCHES] drop if exists

2005-11-16 Thread Andrew Dunstan
Christopher Kings-Lynne said: Will we get this functionality for ALL objects? The patch does these: table, view, index, sequence, schema, type, domain, and conversion. The reason is that these are all dealt with using the same bit of the grammar, and the first 4 are pretty much completely done

Re: [PATCHES] drop if exists

2005-11-16 Thread Christopher Kings-Lynne
I think anything else will have to be done individually, although the pattern can be copied. Perhaps we should take bids on what should/should not be covered. Everything should be covered, otherwise it's just annoying for users... Chris ---(end of

Re: [PATCHES] drop if exists

2005-11-16 Thread Michael Glaesemann
On Nov 17, 2005, at 11:45 , Christopher Kings-Lynne wrote: I think anything else will have to be done individually, although the pattern can be copied. Perhaps we should take bids on what should/should not be covered. Everything should be covered, otherwise it's just annoying for users...

[PATCHES] drop if exists

2005-11-14 Thread Andrew Dunstan
Ther attached patch is for comment. It implements drop if exists as has recently been discussed. Illustration: andrew=# drop table blurflx; ERROR: table blurflx does not exist andrew=# drop table if exists blurflx; DROP TABLE andrew=# create table blurflx ( x text); CREATE TABLE andrew=#

Re: [PATCHES] drop if exists

2005-11-14 Thread Michael Glaesemann
On Nov 14, 2005, at 23:25 , Andrew Dunstan wrote: Ther attached patch is for comment. It implements drop if exists as has recently been discussed. Illustration: Nifty! Thanks for working this up, Andrew! andrew=# drop table blurflx; ERROR: table blurflx does not exist andrew=# drop

Re: [PATCHES] drop if exists

2005-11-14 Thread Dave Page
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Glaesemann Sent: 14 November 2005 14:54 To: Andrew Dunstan Cc: Patches (PostgreSQL) Subject: Re: [PATCHES] drop if exists On Nov 14, 2005, at 23:25 , Andrew Dunstan wrote: Ther

Re: [PATCHES] drop if exists

2005-11-14 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: andrew=# drop table blurflx; ERROR: table blurflx does not exist andrew=# drop table if exists blurflx; DROP TABLE If I read MySQL's documentation correctly, they emit a NOTE (equivalent of a NOTICE message I suppose) when IF EXISTS does nothing

Re: [PATCHES] drop if exists

2005-11-14 Thread Andrew Dunstan
OK, now it looks like this: andrew=# drop table blurflx; ERROR: table blurflx does not exist andrew=# drop table if exists blurflx; NOTICE: table blurflx does not exist, skipping DROP TABLE andrew=# create table blurflx ( x text); CREATE TABLE andrew=# drop table if exists blurflx; DROP TABLE