Re: add additional options to CREATE TABLE ... AS

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Neil Conway <neilc(at)samurai(dot)com>, Kris Jurka <books(at)ejurka(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: add additional options to CREATE TABLE ... AS
Date: 2006-02-15 17:38:51
Message-ID: 1140025131.12131.66.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Tue, 2006-02-14 at 15:38 -0500, Tom Lane wrote:
> Neil Conway <neilc(at)samurai(dot)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

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Stephen Frost 2006-02-15 18:32:09 BUG #2246: Only call pg_fe_getauthname if none given
Previous Message Chris Browne 2006-02-15 17:17:47 Re: Patch Submission Guidelines