pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michal Dobaczewski <mdobaczewski@cc.com.pl>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: libpq: usage of PQoidValue to obtain serial primary
Date: Thu, 22 Jul 2004 15:51:16 +0200
Message-ID: <40FFC654.9000903@cc.com.pl> (raw)
In-Reply-To: <200407221444.56693.peter_e@gmx.net>
References: <40FFA197.9080106@cc.com.pl>
	<200407221444.56693.peter_e@gmx.net>

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.





view thread (4+ messages)  latest in thread

Message-ID: <40FFC654.9000903@cc.com.pl>
Permalink:  ../40FFC654.9000903@cc.com.pl/
Also on:    postgresql.org/message-id/40FFC654.9000903@cc.com.pl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: mdobaczewski@cc.com.pl, peter_e@gmx.net
  Subject: Re: libpq: usage of PQoidValue to obtain serial primary
  In-Reply-To: <40FFC654.9000903@cc.com.pl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox