Re: Ok, what am I doing wrong here? - Mailing list pgsql-sql

From Tomasz Myrta
Subject Re: Ok, what am I doing wrong here?
Date
Msg-id 403242A6.4040302@klaster.net
Whole thread Raw
In response to Ok, what am I doing wrong here?  (Karl Denninger <karl@denninger.net>)
List pgsql-sql
Dnia 2004-02-17 17:02, Użytkownik Karl Denninger napisał:
> 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);

Documentation says:
INSERT INTO table [ ( column [, ...] ) ]    { DEFAULT VALUES | VALUES ( { expression | DEFAULT } [, ...] ) | 
SELECT query }

insert into table (id, time, type)
select id, now(), '1' from secondtable;

Regards,
Tomasz Myrta


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Ok, what am I doing wrong here?
Next
From: Karl Denninger
Date:
Subject: Re: Ok, what am I doing wrong here?