Re: INSERT INTO foo () VALUES ()

[prev] [thread] [next] [Date index for 2004/05/25]

From: cees-cdbi
Subject: Re: INSERT INTO foo () VALUES ()
Date: 15:47 on 25 May 2004
Quoting Simon Cozens <simon@xxxxxxxxxxxx.xxx>:
> Tony Bowden:
> > Is this something else that's going to differ across the various
> > databases? Or is there something standard that everything will be happy
> > with?
> 
> In case it helps, inserting NULL into an auto-incrementing PK does the
> right thing on mysql as well as SQLite. It doesn't work on Postgres.

You can use 'default' instead of 'NULL' in postgres (at least version 7.4.2) to
get postgres to use the default value for the column.

insert into foo values (default);

Cheers,

Cees

INSERT INTO foo () VALUES ()
Simon Cozens 13:55 on 25 May 2004

Re: INSERT INTO foo () VALUES ()
Tony Bowden 14:13 on 25 May 2004

Re: INSERT INTO foo () VALUES ()
Simon Cozens 14:35 on 25 May 2004

Re: INSERT INTO foo () VALUES ()
Tony Bowden 14:37 on 25 May 2004

Re: INSERT INTO foo () VALUES ()
ed-cdbi 14:42 on 25 May 2004

Re: INSERT INTO foo () VALUES ()
Simon Cozens 14:49 on 25 May 2004

Re: INSERT INTO foo () VALUES ()
ed-cdbi 15:13 on 25 May 2004

Re: INSERT INTO foo () VALUES ()
cees-cdbi 15:47 on 25 May 2004

Re: INSERT INTO foo () VALUES ()
Branislav Zahradnik 16:20 on 25 May 2004

RE: INSERT INTO foo () VALUES ()
"g 06:00 on 26 May 2004

Re: INSERT INTO foo () VALUES ()
Edward J. Sabol 14:40 on 26 May 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52