Re: [SQL] Move table between schemas

2004-11-20 Thread Tom Lane
Markus Schaber <[EMAIL PROTECTED]> writes: > Andrew Sullivan <[EMAIL PROTECTED]> wrote: >> CREATE TABLE newschema.newtable AS SELECT * FROM oldschema.oldtable >> oughta work. > - The operation is not atomic, thus there may be inserts and updates > into the old table that get lost while the "CREAT

Re: [SQL] Move table between schemas

2004-11-20 Thread Markus Schaber
Hi, Andrew, On Tue, 16 Nov 2004 06:05:38 -0500 Andrew Sullivan <[EMAIL PROTECTED]> wrote: > > Is there an easy way to move a table to another schema in PostgreSQL 7.4? > > > > ALTER TABLE and ALTER SCHEMA don't have this options. > > CREATE TABLE newschema.newtable AS SELECT * FROM oldschema.ol

Re: [SQL] Move table between schemas

2004-11-16 Thread Andrew Sullivan
On Tue, Nov 16, 2004 at 02:30:09PM +0200, Achilleus Mantzios wrote: > > > > CREATE TABLE newschema.newtable AS SELECT * FROM oldschema.oldtable > > > > oughta work. > > What about indexes, constraints, sequences,etc...??? You'll have to create those too, I'm afraid. I don't know of a way to m

Re: [SQL] Move table between schemas

2004-11-16 Thread Achilleus Mantzios
O Andrew Sullivan έγραψε στις Nov 16, 2004 : > On Tue, Nov 16, 2004 at 10:02:34AM +0100, Markus Schaber wrote: > > Hello, > > > > Is there an easy way to move a table to another schema in PostgreSQL 7.4? > > > > ALTER TABLE and ALTER SCHEMA don't have this options. > > CREATE TABLE newschema.ne

Re: [SQL] Move table between schemas

2004-11-16 Thread Andrew Sullivan
On Tue, Nov 16, 2004 at 10:02:34AM +0100, Markus Schaber wrote: > Hello, > > Is there an easy way to move a table to another schema in PostgreSQL 7.4? > > ALTER TABLE and ALTER SCHEMA don't have this options. CREATE TABLE newschema.newtable AS SELECT * FROM oldschema.oldtable oughta work. A

[SQL] Move table between schemas

2004-11-16 Thread Markus Schaber
Hello, Is there an easy way to move a table to another schema in PostgreSQL 7.4? ALTER TABLE and ALTER SCHEMA don't have this options. Thanks, Markus -- markus schaber | dipl. informatiker logi-track ag | rennweg 14-16 | ch 8001 zürich phone +41-43-888 62 52 | fax +41-43-888 62 53 mailto:[EMAIL