Re: Re: is PG able to handle a >500 GB Database?

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: Florent Guillaume <efgeor(at)noos(dot)fr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Re: is PG able to handle a >500 GB Database?
Date: 2001-01-19 22:27:37
Message-ID: 200101192227.f0JMRbq24013@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Florent Guillaume wrote:
>> Unless your application logic tries to use OIDs as row identifiers,
>> duplicate OIDs in user tables are not a problem.
>
>Hmmm, that means that the following, which I use, is not strictly correct :
>
>create table t1 (recordid SERIAL PRIMARY KEY, val INT4, name TEXT);
>... much later ...
>insert into t1 (val, name) values (3465, 'blah');
>-- PHP application gets $lastoid for this insert
>select recordid from t1 where oid = $lastoid;
>-- PHP application now hast the recordid that was created.
>
>Because the last select could return several lines.
>
>What would be the correct idiom ? Explicitly use nextval ? That pretty
>defeats the point of SERIAL, no ?

SELECT currval('t1_recordid_seq');

currval is guaranteed to return the value that the sequence has just put
into recordid.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"The LORD is my strength and song, and he is become my
salvation; he is my God, and I will prepare him an
habitation; my father's God, and I will exalt him."
Exodus 15:2

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig L. Ching 2001-01-19 22:37:01 RE: Re: couple of general questions
Previous Message Gregory Wood 2001-01-19 22:02:43 Re: Re: couple of general questions