Re: libpq: usage of PQoidValue to obtain serial primary
От | Michal Dobaczewski |
---|---|
Тема | Re: libpq: usage of PQoidValue to obtain serial primary |
Дата | |
Msg-id | 40FFC654.9000903@cc.com.pl обсуждение исходный текст |
Ответ на | Re: libpq: usage of PQoidValue to obtain serial primary key after insert (Peter Eisentraut <peter_e@gmx.net>) |
Ответы |
Re: libpq: usage of PQoidValue to obtain serial primary key after insert
|
Список | pgsql-interfaces |
Peter Eisentraut wrote: > Am Donnerstag, 22. Juli 2004 13:14 schrieb Michal Dobaczewski: > >>Browsing the general list I've just read a post claiming that oid are >>not guaranteed to be unique in the table. This is also stated in the >>documentation - which seems to have escaped me this far. So I assume the >>approach presented above is flawed. >> >>I would like to ask what is a most elegant way to deal with such issues? > > > Create a unique constraint on the oid column. Thanks for the response. I wonder: how will postgres behave if it happens to generate a repetitive oid for a table with such constraint? I understand it will work it out somehow internally and get a different oid, but I would like to be sure. It doesn't create a risk of inserts failing at random, does it? I also understand this theoretically limits the number of rows in a table to 2^32 whereas without such constraint there is no set limit - is that true? It's not a problem, we don't have such big tables so far but it would be interesting to know. Regards, Michal Dobaczewski.
В списке pgsql-interfaces по дате отправления: