Re: Help using SELECT INTO to make schema - Mailing list pgsql-general

From Jeff Davis
Subject Re: Help using SELECT INTO to make schema
Date
Msg-id 1248309632.23273.180.camel@monkey-cat.sm.truviso.com
Whole thread Raw
In response to Help using SELECT INTO to make schema  (Robert James <srobertjames@gmail.com>)
List pgsql-general
On Wed, 2009-07-22 at 18:15 -0400, Robert James wrote:
> I'd like to SELECT INTO one table into another one. However, I'd like
> to do two things that I don't know how to do using SELECT INTO:
>
>  1. Copy over the indexes and constraints of the first table into the
> second

See: http://www.postgresql.org/docs/8.4/static/sql-createtable.html
LIKE parent_table [ { INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS |
INDEXES } ]

> 2. Do SELECT INTO even if the second table already exists.

INSERT INTO foo ... SELECT

Regards,
    Jeff Davis


pgsql-general by date:

Previous
From: Robert James
Date:
Subject: Help using SELECT INTO to make schema
Next
From: John Cheng
Date:
Subject: Re: Problem search on text arrays, using the overlaps (&&) operator