insert into... - Mailing list pgsql-general

From Alain Roger
Subject insert into...
Date
Msg-id 75645bbb0712090805t435b633v7d4d83902d269d5a@mail.gmail.com
Whole thread Raw
Responses Re: insert into...
Re: insert into...
Re: insert into...
List pgsql-general
Hi,

i would like to understand why the following INSERT INTO statement works :

INSERT INTO mytable
   SELECT nextval('my_sequence'),
   'myname',
   'myfirstname'
;

whereas usually we should do :

INSERT INTO mytable
VALUES
(
   SELECT nextval('my_sequence'),
   'myname',
   'myfirstname'
);


thanks a lot,

--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: sequence
Next
From: Michael Glaesemann
Date:
Subject: Re: insert into...