Re: SERIAL type feature request

Поиск
Список
Период
Сортировка
От Jan Wieck
Тема Re: SERIAL type feature request
Дата
Msg-id 43938ECA.9080301@Yahoo.com
обсуждение исходный текст
Ответ на Re: SERIAL type feature request  (Zoltan Boszormenyi <zboszor@dunaweb.hu>)
Ответы Re: SERIAL type feature request  (Michael Glaesemann <grzm@myrealbox.com>)
Re: SERIAL type feature request  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Re: SERIAL type feature request  (Zoltan Boszormenyi <zboszor@dunaweb.hu>)
Список pgsql-hackers
On 12/4/2005 5:10 PM, Zoltan Boszormenyi wrote:
> I found this in the SQL2003 draft:
> 
> "
> 4.14.7 Identity columns
> 
> ... An identity column has a start value, an increment, a maximum value, 
> a minimum value,
> and a cycle option. ...
> "
> 
> The exact properties of a sequence. It would be a good idea to be able 
> to provide
> all these the same way PostgreSQL provides CREATE SEQUENCE.

I think nobody would object to implementing support for the SQL2003 
syntax. Most of that would be providing all the values that will get 
forwarded into the internal sequence generation during CREATE TABLE.

The other thing needed is an extension to the default value mechanism 
that overrides any given value to implement GENERATE ALLWAYS. Not too 
hard either.

> Thinking about it more, 0 is a special value that a sequence created 
> with defaults
> (just like the ones created for SERIAL fields) will not produce. If 
> PostgreSQL

Zero is no more special than any other value and the standard you 
pointed to does not talk about it either. If we implement IDENTITY as 
per standard, you will either omit the value, specify DEFAULT or declare 
the column GENERATE ALLWAYS.

If we had to pick any magic value I would vote for skipping 666 in all 
sequence generators and use that.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: SERIAL type feature request
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: SERIAL type feature request