| From: | Dave Cramer <pg(at)fastcrypt(dot)com> |
|---|---|
| To: | Alain Roger <raf(dot)news(at)gmail(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: insert into... |
| Date: | 2007-12-09 17:02:03 |
| Message-ID: | 66CFF751-8379-4CC9-B410-F49499FD2EC7@fastcrypt.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Vyacheslav Kalinin | 2007-12-09 17:58:08 | Re: Pg_catalog reference |
| Previous Message | Michael Glaesemann | 2007-12-09 16:41:47 | Re: insert into... |