INSERT Issues
INSERT Issues
От:
"Rod Taylor" <rod.taylor@inquent.com>
Дата:
CREATE TABLE junk ( col SERIAL PRIMARY KEY
);
INSERT INTO junk (col) DEFAULT VALUES;
INSERT INTO junk DEFAULT VALUES:
Second insert works, first one fails.
INSERT INTO table [ ( column [, ...] ) ] { DEFAULT VALUES | VALUES ( expression [, ...] ) | SELECT query }
The column list should just be ignored correct?
--
Rod Taylor
There are always four sides to every story: your side, their side, the
truth, and what really happened.
Re: INSERT Issues
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Rod Taylor" writes:
> INSERT INTO table [ ( column [, ...] ) ]
> { DEFAULT VALUES | VALUES ( expression [, ...] ) | SELECT query }
The documentation is wrong here, not the code. SQL92 defines the syntax
as
::= INSERT INTO Re: INSERT Issues
От:
"Rod Taylor" <rod.taylor@inquent.com>
Дата:
create table junk (col SERIAL); INSERT INTO junk (col) VALUES (DEFAULT); ERROR: parser: parse error at or near "DEFAULT"; > INSERT INTO junk (col) VALUES (DEFAULT); > > Does that work for you? > > Ross >
Re: INSERT Issues
От:
"Ross J. Reedstrom" <reedstrm@rice.edu>
Дата:
On Thu, Apr 05, 2001 at 07:16:49PM -0400, Rod Taylor wrote:
> CREATE TABLE junk (
> col SERIAL PRIMARY KEY
> );
>
> INSERT INTO junk (col) DEFAULT VALUES;
>
> INSERT INTO junk DEFAULT VALUES:
>
>
> Second insert works, first one fails.
>
> INSERT INTO table [ ( column [, ...] ) ]
> { DEFAULT VALUES | VALUES ( expression [, ...] ) | SELECT query }
>
>
> The column list should just be ignored correct?
>
Hmm, the BNF from SQL1992 actually is:
::= INSERT INTO