X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 7338ED1DF85 for ; Tue, 17 Feb 2004 16:03:15 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 18949-01 for ; Tue, 17 Feb 2004 12:03:08 -0400 (AST) Received: from FS.Denninger.Net (user66.net1062.fl.sprint-hsd.net [69.34.227.66]) by svr1.postgresql.org (Postfix) with ESMTP id 4F156D1DD60 for ; Tue, 17 Feb 2004 12:03:07 -0400 (AST) Received: from fs.denninger.net (localhost [127.0.0.1]) by FS.Denninger.Net (8.12.10/8.12.8) with SMTP id i1HG2osI066117 for ; Tue, 17 Feb 2004 10:02:50 -0600 (CST) (envelope-from karl@FS.Denninger.Net) Received: from fs.denninger.net [127.0.0.1] by Spamblock-sys; Tue Feb 17 10:02:50 2004 Received: (from karl@localhost) by FS.Denninger.Net (8.12.10/8.12.8/Submit) id i1HG2o2j066115 for pgsql-sql@postgresql.org; Tue, 17 Feb 2004 10:02:50 -0600 (CST) Message-ID: <20040217100250.A65968@Denninger.Net> Date: Tue, 17 Feb 2004 10:02:50 -0600 From: Karl Denninger To: pgsql-sql@postgresql.org Subject: Ok, what am I doing wrong here? Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i Organization: Karl's Sushi and Packet Smashers X-Die-Spammers: Spammers cheerfully broiled for supper and served with ketchup! X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/209 X-Sequence-Number: 16899 I want to insert values from one table into another, and add some "default" values (that are not defaults on the table different reasons - that is, this is maintenance function and in normal operation there would be "real" values there - and null is valid) So, I want to do, for example, the following: insert into table (id, time, type) values (select id, now(), '1' from secondtable); Postgres's command line pukes on this, complaining that "select" is invalid inside the values part of the definition. SQL's language specification says otherwise, as does "\h insert" from the command line. The query stand-alone returns a table with values that are valid for the table I wish to insert into. Where's my brain-fade on this? -- -- Karl Denninger (karl@denninger.net) Internet Consultant & Kids Rights Activist http://www.denninger.net Tired of spam at your company? LOOK HERE! http://childrens-justice.org Working for family and children's rights http://diversunion.org LOG IN AND GET YOUR TANK STICKERS TODAY! http://scubaforum.org Come talk about DIVING!