Re: Autoincremental value
От | Harald Fuchs |
---|---|
Тема | Re: Autoincremental value |
Дата | |
Msg-id | puhdr5yhoe.fsf@srv.protecting.net обсуждение исходный текст |
Ответ на | Autoincremental value (adburne@asocmedrosario.com.ar) |
Ответы |
Re: Autoincremental value
|
Список | pgsql-general |
In article <14610181509.20040813135048@asocmedrosario.com.ar>, adburne@asocmedrosario.com.ar writes: > Hi I'm a newbie in postgresql, I came from MSSQL, MySQL and now > I'm testing postgres. > In mysql there is a way to make a second autoincrement field, just: > create table table1 > (field1 integer, > field2 integer autoincrement, > primary key (field1,field2)) > when insert rows: > insert into table1 (field1) values (1); > insert into table1 (field1) values (1); > insert into table1 (field1) values (2); > and then select * from table1, you get: > field1| field2 > ------+------- > 1 | 1 > 1 | 2 > 2 | 1 > ------+------- Even MySQL disallows that - unless you use the MyISAM backend. The only time when I used this ugly hack was when I looked for a workaround to the missing subselects. Perhaps you should describe what you're trying to achieve. I'm pretty sure PostgreSQL has an elegant solution for that.
В списке pgsql-general по дате отправления: