X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1100BD1B1DC for ; Thu, 22 Jul 2004 10:51:59 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 48755-02 for ; Thu, 22 Jul 2004 13:52:03 +0000 (GMT) Received: from skinner.cc.com.pl (py98.internetdsl.tpnet.pl [80.55.24.98]) by svr1.postgresql.org (Postfix) with ESMTP id E98D5D1B16A for ; Thu, 22 Jul 2004 10:51:54 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by skinner.cc.com.pl (Postfix) with ESMTP id F3A243F3C4; Thu, 22 Jul 2004 14:52:51 +0200 (CEST) Message-ID: <40FFC654.9000903@cc.com.pl> Date: Thu, 22 Jul 2004 15:51:16 +0200 From: Michal Dobaczewski User-Agent: Mozilla Thunderbird 0.7.2 (Windows/20040707) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Peter Eisentraut Cc: pgsql-interfaces@postgresql.org Subject: Re: libpq: usage of PQoidValue to obtain serial primary References: <40FFA197.9080106@cc.com.pl> <200407221444.56693.peter_e@gmx.net> In-Reply-To: <200407221444.56693.peter_e@gmx.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiVirus: OK! AntiVir MailGate Version 2.0.0.9; AVE: 6.26.0.10; VDF: 6.26.0.38 at skinner.cc.com.pl has not found any known virus in this email. X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/37 X-Sequence-Number: 5043 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.