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 93FE2D1B1D1 for ; Thu, 22 Jul 2004 14:54:26 -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 68204-05 for ; Thu, 22 Jul 2004 17:54:18 +0000 (GMT) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id 2F396D1B1C8 for ; Thu, 22 Jul 2004 14:54:16 -0300 (ADT) Received: (qmail 27238 invoked by uid 65534); 22 Jul 2004 17:54:16 -0000 Received: from dsl-213-023-255-061.arcor-ip.net (EHLO colt.pezone.net) (213.23.255.61) by mail.gmx.net (mp011) with SMTP; 22 Jul 2004 19:54:16 +0200 X-Authenticated: #495269 From: Peter Eisentraut To: Michal Dobaczewski Subject: Re: libpq: usage of PQoidValue to obtain serial primary key after insert Date: Thu, 22 Jul 2004 19:54:15 +0200 User-Agent: KMail/1.5.1 Cc: pgsql-interfaces@postgresql.org References: <40FFA197.9080106@cc.com.pl> <200407221444.56693.peter_e@gmx.net> <40FFC654.9000903@cc.com.pl> In-Reply-To: <40FFC654.9000903@cc.com.pl> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200407221954.15525.peter_e@gmx.net> 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/40 X-Sequence-Number: 5046 Michal Dobaczewski wrote: > I wonder: how will postgres behave if it happens to generate a > repetitive oid for a table with such constraint? You get a constraint violation error. > I understand it will > work it out somehow internally and get a different oid, No. > but I would > like to be sure. It doesn't create a risk of inserts failing at > random, does it? Yes, it would (for certain definitions of "random"). > 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. If you're concerned about that, you better go back to sequences and use bigserial columns. -- Peter Eisentraut http://developer.postgresql.org/~petere/