Re: [SQL] INSERT w/o variable names for a SERIAL type?

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: [SQL] INSERT w/o variable names for a SERIAL type?
Дата
Msg-id 20000227134402.A5030@rice.edu
обсуждение исходный текст
Ответ на Re: [SQL] INSERT w/o variable names for a SERIAL type?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: [SQL] INSERT w/o variable names for a SERIAL type?  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-sql
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
-- 
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> 
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005



В списке pgsql-sql по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [SQL] INSERT w/o variable names for a SERIAL type?
Следующее
От: maillist@remo.demon.co.uk
Дата:
Сообщение: Rule (which multiple actions) problem with history table.....