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" (

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 broadcast)-

Re: [HACKERS] drop if exists

2005-10-15 Thread Bernd Helmle
--On Samstag, Oktober 15, 2005 17:20:06 +0200 Martijn van Oosterhout 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 don't think this

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

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 >> co

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 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 DRO

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 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 EX

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 o

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 an

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, sequenc

[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 indeed,