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

From David E. Wheeler
Subject Re: CREATE TABLE IF NOT EXISTS AS
Date
Msg-id 60C70888-3841-432F-B50B-7415E2915C30@justatheory.com
Whole thread Raw
In response to Re: CREATE TABLE IF NOT EXISTS AS  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: CREATE TABLE IF NOT EXISTS AS  (Fabrízio de Royes Mello <fabriziomello@gmail.com>)
List pgsql-hackers
On Nov 16, 2013, at 4:40 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

>> Co-worker asked a question I could not answer: Why is IF NOT EXISTS not supported by CREATE TABLE AS?
>
> That's an even worse idea than plain CREATE IF NOT EXISTS (which was
> put in over vocal objections from me and some other people).  Not only
> would you not have the faintest clue as to the properties of the table
> afterwards, but no clue as to its contents either.

You mean that, after running it, one cannot tell whether or not a new table was created or not without looking at it? I
guessthat makes sense, though sometimes I like to tell the system to assume that I know what I’m doing -- e.g., that
eitheroutcome works for me. 

Not essential as a core feature, mind you; I can use DO to accomplish the same thing. It’s just a bit more work that
way.And perhaps that’s for the best. 

Best,

David




pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: additional json functionality
Next
From: Tom Lane
Date:
Subject: Re: proposal: simple date constructor from numeric values