Re: add "WITH OIDS" to CREATE TABLE AS

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: add "WITH OIDS" to CREATE TABLE AS
Date: 2004-01-06 19:44:21
Message-ID: 200401061944.i06JiLE27066@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Neil Conway wrote:
> This patch adds a "WITH / WITHOUT OIDS" clause to CREATE TABLE
> AS. This allows the user to explicitly specify whether OIDs should be
> included in the newly-created relation (if form of this clause is
> specified, the default_with_oids configuration variable is used). This
> is useful because it provides a way for application authors to ensure
> their applications are compatible with future versions of PostgreSQL
> (in which the relation created by CREATE TABLE AS won't include OIDs
> by default).
>
> No equivalent functionality has been added to SELECT INTO: there
> isn't a convenient syntax for it that I could see, and in any case
> CREATE TABLE AS has always offered a superset of the functionality of
> SELECT INTO. Therefore, I don't view this as a problem.
>
> The implementation is a tad messy (it would be nice if CREATE TABLE AS
> were a distinct node, to avoid needing to clutter up SelectStmt
> further). I also needed to add an additional production to avoid a
> shift/reduce conflict in the parser (see the XXX note in the patch
> itself).
>
> The patch includes updates to the documentation and regression tests.

Does this deal with the fact we now emit WITH/WITHOUT OID in pg_dump?
FYI, that is a must-fix for 7.5 for portability reasons.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2004-01-06 19:46:03 Re: move 'Value' node into separate file
Previous Message Neil Conway 2004-01-06 19:25:57 add "WITH OIDS" to CREATE TABLE AS