Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f29Gufx83890 for ; Fri, 9 Mar 2001 11:56:41 -0500 (EST) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 22765; Fri, 09 Mar 2001 08:56:35 -0800 From: "Josh Berkus" Subject: Re: cannot get CREATE TABLE AS to work To: "Creager, Robert S" Cc: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Fri, 09 Mar 2001 08:56:35 -0800 Message-ID: In-Reply-To: <10FE17AD5F7ED31188CE002048406DE8514CE0@lsv-msg06.stortek.com> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200103/195 X-Sequence-Number: 1848 Robert, > How then can I add in a DEFAULT nextval in place of SERIAL and get > the > REFERENCES in there? Or can I? You can't (as far as I know). If that's important to you, you need to create the table first with a regular CREATE TABLE statement, then do INSERT INTO. CREATE TABLE AS is, I believe, primarily for temporary tables. It's also a good idea to stay away from CREATE TABLE AS in applications that might have to be portable; this is one statment whose syntax varies widely from platform to platform. For example, Transact-SQL (MS) uses SELECT ... INTO instead of CREATE TABLE AS. -Josh Berkus ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco