Search Postgresql Archives

Re: insert into...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Values is optional.  We support insert into select

Dave
On 9-Dec-07, at 11:05 AM, Alain Roger wrote:

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


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux