Re: Re: is PG able to handle a >500 GB Database? - Mailing list pgsql-general

From rob
Subject Re: Re: is PG able to handle a >500 GB Database?
Date
Msg-id 003301c082ba$3091bfc0$4100fd0a@cabrion.org
Whole thread Raw
In response to Re: Re: is PG able to handle a >500 GB Database?  ("Oliver Elphick" <olly@lfix.co.uk>)
Responses Re: is PG able to handle a >500 GB Database?  (Florent Guillaume <efgeor@noos.fr>)
Re: Re: Re: is PG able to handle a >500 GB Database?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
currval returns error unless nextval has been called at least once in the
session.

I use <seq>.last_value

Perhaps I'm fooling myself that the latter is doing what I think, but it
seems to work fine and doesn't require an initial call to nextval.

I too thought that OID was always unique.  That is not true?

--rob




----- Original Message -----
From: "Oliver Elphick" <olly@lfix.co.uk>
To: "Florent Guillaume" <efgeor@noos.fr>
Cc: <pgsql-general@postgresql.org>
Sent: Friday, January 19, 2001 5:27 PM
Subject: Re: Re: is PG able to handle a >500 GB Database?


> 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.Elphick@lfix.co.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
>
>
>


pgsql-general by date:

Previous
From: "rob"
Date:
Subject: Re: Re: MS Access data to PostgrSQL data
Next
From: Ron Chmara
Date:
Subject: Re: Re: Re: couple of general questions