From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu> |
Cc: | "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: CREATE TABLE AS standard? |
Date: | 2000-05-01 15:49:01 |
Message-ID: | 200005011549.LAA19207@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> > I know I use that version my self a lot more than the SELECT INTO
> > version. We probably got it 'free' from the CREATE VIEW semantics,
> > as Tom suggested. I tend to use it to 'materialize' a new table when
> > I'm altering schema (either denormalizing, or normalizing) and need to
> > convert the type of a column. It's a little handier than separate CREATE
> > TABLE and INSERT INTO statements, although it's semantically equivalent.
>
> I implemented CREATE TABLE AS as a semantically clearer version of
> SELECT/INTO, which was (afaik) in the original Postgres95 and probably
> earlier.
>
> They are equivalent. btw, I assume that Tom used the term "abuse" in
> the supportive sense of the word? :)
>
I covered SELECT...INTO in my book, with a short paragraph showing
CREATE TABLE...AS is equivalent. Which one should I use in my book as
the preferred?
--
Bruce Momjian | http://www.op.net/~candle
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Lockhart | 2000-05-01 16:03:33 | Re: CREATE TABLE AS standard? |
Previous Message | Thomas Lockhart | 2000-05-01 13:06:59 | Re: How to compile a dynamically loadable object file |