[HACKERS] DROP/IF_P EXISTS in gram.y

2006-08-02 Thread Michael Meskes
Is there any reason why all DROP statements except DROP CAST have two rules, one with IF_P EXISTS and one without, while DROP CAST uses opt_if_exists? Michael -- Michael Meskes Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) ICQ: 179140304, AIM/Yahoo: michaelmeskes,

Re: [HACKERS] DROP/IF_P EXISTS in gram.y

2006-08-02 Thread Andrew Dunstan
Michael Meskes wrote: Is there any reason why all DROP statements except DROP CAST have two rules, one with IF_P EXISTS and one without, while DROP CAST uses opt_if_exists? With all the others that was the only way to stop getting a grammar conflict, IIRC. cheers andrew

Re: [HACKERS] drop if exists

2005-10-15 Thread Jari Aalto
Alvaro Herrera [EMAIL PROTECTED] writes: Andrew Dunstan wrote: | | From time to time the suggestion crops up of allowing a DROP IF EXISTS | ... syntax. This seems not unreasonable, and I just spent a few minutes | looking at what might be involved. What about CREATE IF NOT EXISTS

Re: [HACKERS] drop if exists

2005-10-15 Thread Andrew Dunstan
Rod Taylor wrote: On Fri, 2005-10-14 at 20:29 -0400, Andrew Dunstan wrote: From time to time the suggestion crops up of allowing a DROP IF EXISTS ... syntax. This seems not unreasonable, and I just spent a few minutes looking at what might be involved. Especially in the case of a table,

Re: [HACKERS] drop if exists

2005-10-15 Thread Andrew Dunstan
Alvaro Herrera wrote: Andrew Dunstan wrote: From time to time the suggestion crops up of allowing a DROP IF EXISTS ... syntax. This seems not unreasonable, and I just spent a few minutes looking at what might be involved. What about CREATE IF NOT EXISTS (CINE)? If we support DROP

Re: [HACKERS] drop if exists

2005-10-15 Thread Martijn van Oosterhout
On Fri, Oct 14, 2005 at 10:32:02PM -0300, Alvaro Herrera wrote: What about CREATE IF NOT EXISTS (CINE)? If we support DROP IF EXISTS (DIE), is the other one going to be supported too? CINE already exists sortof, it's called CREATE OR REPLACE. Although the effect is obvious for functions, it

Re: [HACKERS] drop if exists

2005-10-15 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: Rod Taylor wrote: I would rather have a 'rollback or release savepoint' command which would rollback to the savepoint if there was an error or release it otherwise. This way any command or combination of commands could be aborted or continued as a

Re: [HACKERS] drop if exists

2005-10-15 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: Alvaro Herrera wrote: Also, DIE does not need to lock the table afterwards because it won't exist, but CINE needs to keep a lock until transaction commit. Right. That's one reason I thought of starting with the DIE case ;-) That argument seems pretty

Re: [HACKERS] drop if exists

2005-10-15 Thread Bernd Helmle
--On Samstag, Oktober 15, 2005 17:20:06 +0200 Martijn van Oosterhout kleptog@svana.org wrote: Although the effect is obvious for functions, it seems to me that it would be cool to make a CREATE OR REPLACE TABLE that simply does nothing if the table already exists with the right format. Hmm i

Re: [HACKERS] drop if exists

2005-10-15 Thread Andrew Dunstan
Tom Lane wrote: We know that DIE is a convenient, useful semantics because people keep asking for it. I think CINE has no track record. You have confirmed my initial instinct. I will get this done for 8.2. cheers andrew ---(end of

Re: [HACKERS] drop if exists

2005-10-15 Thread Darko Prenosil
Andrew Dunstan wrote: Alvaro Herrera wrote: Andrew Dunstan wrote: From time to time the suggestion crops up of allowing a DROP IF EXISTS ... syntax. This seems not unreasonable, and I just spent a few minutes looking at what might be involved. What about CREATE IF NOT EXISTS

[HACKERS] drop if exists

2005-10-14 Thread Andrew Dunstan
From time to time the suggestion crops up of allowing a DROP IF EXISTS ... syntax. This seems not unreasonable, and I just spent a few minutes looking at what might be involved. Especially in the case of a table, view, sequence and index the changes look like they would be very modest

Re: [HACKERS] drop if exists

2005-10-14 Thread David Fetter
On Fri, Oct 14, 2005 at 08:29:43PM -0400, Andrew Dunstan wrote: From time to time the suggestion crops up of allowing a DROP IF EXISTS ... syntax. This seems not unreasonable, and I just spent a few minutes looking at what might be involved. Especially in the case of a table, view, sequence

Re: [HACKERS] drop if exists

2005-10-14 Thread Rod Taylor
On Fri, 2005-10-14 at 20:29 -0400, Andrew Dunstan wrote: From time to time the suggestion crops up of allowing a DROP IF EXISTS ... syntax. This seems not unreasonable, and I just spent a few minutes looking at what might be involved. Especially in the case of a table, view, sequence and

Re: [HACKERS] drop if exists

2005-10-14 Thread Alvaro Herrera
Andrew Dunstan wrote: From time to time the suggestion crops up of allowing a DROP IF EXISTS ... syntax. This seems not unreasonable, and I just spent a few minutes looking at what might be involved. What about CREATE IF NOT EXISTS (CINE)? If we support DROP IF EXISTS (DIE), is the other