Re: Is a SERIAL column a "black box", or not?
От
Rod Taylor
Тема
Re: Is a SERIAL column a "black box", or not?
Дата
Msg-id
1146360362.839.104.camel@home
Ответ на
Is a SERIAL column a "black box", or not? (Tom Lane)
Список
Дерево обсуждения
Is a SERIAL column a "black box", or not? Tom Lane <tgl@sss.pgh.pa.us>
Re: Is a SERIAL column a "black box", or not? Rod Taylor <pg@rbt.ca>
Re: Is a SERIAL column a "black box", or not? Tom Lane <tgl@sss.pgh.pa.us>
Re: Is a SERIAL column a "black box", or not? Rod Taylor <pg@rbt.ca>
Re: Is a SERIAL column a "black box", or not? Thomas Hallgren <thomas@tada.se>
Re: Is a SERIAL column a "black box", or not? mark@mark.mielke.cc
Re: Is a SERIAL column a "black box", or not? Hannu Krosing <hannu@skype.net>
Re: Is a SERIAL column a "black box", or not? mark@mark.mielke.cc
Re: Is a SERIAL column a "black box", or not? "Jim C. Nasby" <jnasby@pervasive.com>
Re: Is a SERIAL column a "black box", or not? Tom Lane <tgl@sss.pgh.pa.us>
Re: Is a SERIAL column a "black box", or not? elein <elein@varlena.com>
Re: Is a SERIAL column a "black box", or not? "Jim C. Nasby" <jnasby@pervasive.com>
Re: Is a SERIAL column a "black box", or not? elein <elein@varlena.com>
Re: Is a SERIAL column a "black box", or not? "Jim C. Nasby" <jnasby@pervasive.com>
Re: Is a SERIAL column a "black box", or not? elein <elein@varlena.com>
Re: Is a SERIAL column a "black box", or not? Martijn van Oosterhout <kleptog@svana.org>
Re: Is a SERIAL column a "black box", or not? Bruno Wolff III <bruno@wolff.to>
Re: Is a SERIAL column a "black box", or not? Tom Lane <tgl@sss.pgh.pa.us>
Re: Is a SERIAL column a "black box", or not? mark@mark.mielke.cc
Re: Is a SERIAL column a "black box", or not? Tom Lane <tgl@sss.pgh.pa.us>
Re: Is a SERIAL column a "black box", or not? mark@mark.mielke.cc
Re: Is a SERIAL column a "black box", or not? Tom Lane <tgl@sss.pgh.pa.us>
Re: Is a SERIAL column a "black box", or not? "Jim C. Nasby" <jnasby@pervasive.com>
Re: Is a SERIAL column a "black box", or not? Tom Lane <tgl@sss.pgh.pa.us>
Re: Is a SERIAL column a "black box", or not? Lukas Smith <smith@pooteeweet.org>
Re: Is a SERIAL column a "black box", or not? Bruno Wolff III <bruno@wolff.to>
Re: Is a SERIAL column a "black box", or not? Tom Lane <tgl@sss.pgh.pa.us>
Re: Is a SERIAL column a "black box", or not? Greg Stark <gsstark@mit.edu>
Re: Is a SERIAL column a "black box", or not? Tom Lane <tgl@sss.pgh.pa.us>
Re: Is a SERIAL column a "black box", or not? elein <elein@varlena.com>
Re: Is a SERIAL column a "black box", or not? Svenne Krap <svenne@krap.dk>
Re: Is a SERIAL column a "black box", or not? "Jim C. Nasby" <jnasby@pervasive.com>
Re: Is a SERIAL column a "black box", or not? Christopher Kings-Lynne <chris.kings-lynne@calorieking.com>
Re: Is a SERIAL column a "black box", or not? Mark Dilger <pgsql@markdilger.com>
Re: Is a SERIAL column a "black box", or not? mark@mark.mielke.cc
Re: Is a SERIAL column a "black box", or not? Mark Dilger <pgsql@markdilger.com>
On Sat, 2006-04-29 at 17:54 -0400, Tom Lane wrote:
> In some recent activity on the patches list about responding to bug #2073,
> http://archives.postgresql.org/pgsql-bugs/2005-11/msg00303.php
> we've been discussing various possible tweaks to the behavior of dropping
> or modifying a serial column. The hacks involved with SERIAL seem to me
> to be getting uglier and uglier, and I think it's time to take a step
> back and consider what we really want SERIAL to act like.
>
> It seems to me there are two basic philosophies at war here:
>
> 1. A serial column is a "black box" that you're not supposed to muck with
> the innards of.
> 2. A serial declaration is just a "macro" for setting up a sequence and a
> column default expression. This was the original viewpoint and indeed is
> still what it says in the documentation:
> Comments, other opinions?
Do both. Return SERIAL to being a macro and implement the SQL IDENTITY
construct as the black box version.
CREATE TABLE foo (bar integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY);
INSERT ... RETURNS needs to be implemented before SERIAL can become a
black box. Until that time we will still need some knowledge of the
sequence involved.
--
В списке pgsql-hackers по дате отправления