On Sun, Feb 27, 2000 at 02:04:42PM -0500, Bruce Momjian wrote:
> > > INSERT INTO my_table VALUES (a, b, c, DEFAULT, x, y, z, ...);
> > I think that is legal SQL92 syntax, but Postgres doesn't accept it
> > at present.
> The problem is when you are inserting >50 columns, it is a pain. The
> use of DEFAULT would also allow SERIAL columns to get the proper
> nextval(), rather than having specify the nextval() call specifically.
This, I think, is the best reason for doing it: even if you call
out the column names, as Tom rightly mentions is best, using DEFAULT
allows writing INSERTs without depending on the details of how SERIAL
is implemented in pgsql: i.e. knowing the algorithm for constructing
the sequenec name.
> Added to TODO.
Perhaps we should note which items on the TODO list are needed for what
level of SQL92 compliance. This one, for example, is not necessary for
ENTRY level, but required at INTERMEDIATE. Not that that should stop
anyone from implementing it: SQL92 Entry is a surprisingly limited
subset, and we have a lot of INTERMEDIATE and FULL features, already.
Ross J. Reedstrom, Ph.D., <reedstrm(at)rice(dot)edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005
In response to
pgsql-sql by date
|Next:||From: maillist||Date: 2000-02-27 22:45:31|
|Subject: Rule (which multiple actions) problem with history table.....|
|Previous:||From: Bruce Momjian||Date: 2000-02-27 19:04:42|
|Subject: Re: [SQL] INSERT w/o variable names for a SERIAL type?|