Search Postgresql Archives

Re: Help using SELECT INTO to make schema

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux