Re: CREATE TABLE IF NOT EXISTS AS - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: CREATE TABLE IF NOT EXISTS AS
Date
Msg-id 528C6C13.1000209@2ndquadrant.com
Whole thread Raw
In response to Re: CREATE TABLE IF NOT EXISTS AS  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On 11/20/2013 03:41 PM, Pavel Stehule wrote:
> 
>     It'd be great if there was a sane way to implement "CREATE OR REPLACE
>     TABLE" - since that's what people really want a lot of the time. "Ensure
>     that at the end of this command the table looks like this". There's just
>     no sane way to do that for a non-empty table.
> 
> 
> I disagree - CREATE OR REPLACE FUNCTION has sense, because new function
> can has same interface (and will be overwriten) or different (and there
> will be two functions). So with CREATE OR REPLACE TABLE there are two
> new questions - has to new table respect original interface and what
> about content? I don't think so CREATE OR REPLACE TABLE is good idea.

Er, that's what I was saying. It'd be great if it were possible to do it
sanely, but it isn't.

-- Craig Ringer                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Compile and test in netbeans
Next
From: Craig Ringer
Date:
Subject: Easily reading debug_print_plan