Re: [HACKERS] Sequences....

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Sequences....
Дата
Msg-id 199903171618.LAA10133@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Sequences....  (Clark Evans <clark.evans@manhattanproject.com>)
Список pgsql-hackers
> Wow. Serious effort here.
> 
> Ryan Bradetich wrote:
> > 1. Leave it as it is now.  It works, just explain to 
> > people that sequences and tables are seperate entities, 
> > and the serial type is just a shortcut.
> 
> I dislike this approach. It seems that it is hiding detail
> that is necessary for proper maintence.  It isn't that
> hard to type in the code.  IMHO, the shortcut causes more
> confusion that it helps.  So, I propose a third option:
> 
> 0.  Remove the SERIAL construct.

When they create a serial, we tell them:
ltest=> create table testx(x serial);NOTICE:  CREATE TABLE will create implicit sequence testx_x_seq forSERIAL column
testx.xNOTICE: CREATE TABLE/UNIQUE will create implicit index testx_x_key fortable testxCREATE
 

So it is not so terrible to tell them they have to delete it when
finished.  We could also add a column to pg_class which tells us this
sequence was auto-created from oid 12, and remove it when we delete a
table.  Or, we could name just try to delete a sequence that has the
name of the table with _seq at the end.


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: "D'Arcy" "J.M." Cain
Дата:
Сообщение: Re: [HACKERS] Problems with >2GB tables on Linux 2.0
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Modulo syntax