Re: [HACKERS] AUTO_INCREMENT suggestion
| От | Mattias Kregert |
|---|---|
| Тема | Re: [HACKERS] AUTO_INCREMENT suggestion |
| Дата | |
| Msg-id | 34FFD3DA.4260663C@algonet.se обсуждение исходный текст |
| Ответ на | AUTO_INCREMENT suggestion ("D. Dante Lorenso" <dlorenso@afai.com>) |
| Список | pgsql-hackers |
D. Dante Lorenso wrote: > > To aid those of us that don't want to use sequences, can we add a > feature to 6.4 that allows the use of an AUTO_INCREMENT statement > when defining tables? MySQL does this, and I like it. It resembles > the Autonumber feature in Access as well. > > create table tblFirm ( > FirmID int PRIMARY KEY AUTO_INCREMENT, > FirmTypeID int, > FirmName varchar(64) NOT NULL, > FirmAlpha char(20) NOT NULL UNIQUE, > FirmURL varchar(64), > FirmEmail varchar(64) > ); > > Just yet another suggestion. > > Dante Since the PRIMARY KEY is implemented by creating an unique index on the field, it should be easy to implement AUTO_INCREMENT by automagically creating a sequence and setting it as the default for this field. Was PRIMARY KEY implemented in the parser? /* m */
В списке pgsql-hackers по дате отправления: