From: Karl Denninger <karl@denninger.net>
To: pgsql-sql@postgresql.org
Subject: Ok, what am I doing wrong here?
Date: Tue, 17 Feb 2004 10:02:50 -0600
Message-ID: <20040217100250.A65968@Denninger.Net> (raw)
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!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: karl@denninger.net
Subject: Re: Ok, what am I doing wrong here?
In-Reply-To: <20040217100250.A65968@Denninger.Net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox