Re: add additional options to CREATE TABLE ... AS - Mailing list pgsql-patches

From Simon Riggs
Subject Re: add additional options to CREATE TABLE ... AS
Date
Msg-id 1140025131.12131.66.camel@localhost.localdomain
Whole thread Raw
In response to Re: add additional options to CREATE TABLE ... AS  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
On Tue, 2006-02-14 at 15:38 -0500, Tom Lane wrote:
> Neil Conway <neilc@samurai.com> writes:
> > The implementation is pretty ugly -- it clutters ExecuteStmt and Query
> > with fields that really do not belong there. Per previous discussion, I
> > think it would be better to refactor the CREATE TABLE AS implementation
> > to be essentially a CREATE TABLE followed by a INSERT ... SELECT.
>
> I kinda wonder why bother at all.  I don't see any good reason why
> people shouldn't issue two statements.

The good reason is that CREATE plus INSERT SELECT is extremely bug prone
and very annoying to have to code SQL that way. CTAS is sent from on
high, IMHO, even without the performance optimisation.

Best Regards, Simon Riggs


pgsql-patches by date:

Previous
From: Kris Jurka
Date:
Subject: Re: add additional options to CREATE TABLE ... AS
Next
From: Stephen Frost
Date:
Subject: BUG #2246: Only call pg_fe_getauthname if none given