Skip site navigation (1) Skip section navigation (2)

Re: Fix command completion for CREATE TABEL ... AS

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fernando Nasser <fnasser(at)redhat(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Fix command completion for CREATE TABEL ... AS
Date: 2002-02-23 21:19:26
Message-ID: 26860.1014499166@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Fernando Nasser <fnasser(at)redhat(dot)com> writes:
> I have no problem with that.  I will be pleased to make SELECT...INTO
> generate a CreateAsStmt and it will also print CREATE.

Well, if you want to do that then there should be actual revisions to
the parsetree representation (viz, get rid of INTO), so as to make this
stuff cleaner instead of dirtier.  INTO is really quite messy right now,
since we have to cope with pulling what ought to be a top-level
construct out of a nested SelectStmt.  I would like to see CreateAs
be a separate statement construct having three fields: target table
name, optional column name list, and source SelectStmt (pointer to
a SELECT parsetree).  Then we could remove the INTO field from
SelectStmt and make the parsetree and parse analysis work cleaner.

However, right now this transformation is (effectively) done in
analyze.c, and I'm not sure whether it can be done as cleanly in
gram.y.  But do take a look at it ...

The alternative is to stick with the existing parsetree representation
and just tweak the command-tag-extraction code to look for an into
clause and print CREATE if so.

			regards, tom lane

In response to

Responses

pgsql-patches by date

Next:From: Bruce MomjianDate: 2002-02-23 21:25:20
Subject: Re: Makefile.aix patch for shlib's
Previous:From: Bruce MomjianDate: 2002-02-23 19:38:54
Subject: Re: stupid patch of pg_dumplo

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group