Received: from send103.yahoomail.com (send103.yahoomail.com [205.180.60.92]) by hub.org (8.9.2/8.9.1) with SMTP id QAA32269 for ; Thu, 4 Feb 1999 16:31:24 -0500 (EST) (envelope-from molivier@yahoo.com) Message-ID: <19990204213433.2881.rocketmail@send103.yahoomail.com> Received: from [207.181.255.215] by send103.yahoomail.com; Thu, 04 Feb 1999 13:34:33 PST Date: Thu, 4 Feb 1999 13:34:33 -0800 (PST) From: Michael Olivier Subject: Re: [SQL] keeping OID's when copying table To: Bruce Momjian Cc: pgsql-sql@postgreSQL.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii ---Bruce Momjian wrote: > > Thank you for pointing out my error. It should be: > > CREATE TABLE new_table (mycol int); > INSERT INTO new_table (oid, mycol) SELECT oid, mycol FROM old_table; > > I have updated the FAQ. Hmm... now I don't get an error, but the oid isn't preserved. This is running 6.3.2 on RH Linux: dmdemo=> CREATE TABLE new_table (mycol int); CREATE dmdemo=> CREATE TABLE old_table (mycol int); CREATE dmdemo=> insert into old_table values (33); INSERT 837643 1 dmdemo=> select oid from old_table; oid ------ 837643 (1 row) dmdemo=> INSERT INTO new_table (oid, mycol) SELECT oid, mycol FROM dmdemo-> old_table; INSERT 837644 1 dmdemo=> select oid from new_table; oid ------ 837644 (1 row) Further suggestions? _________________________________________________________ DO YOU YAHOO!? Get your free @yahoo.com address at http://mail.yahoo.com