Re: Where pg saves the next OID?

From: Emanuel Calvo Franco <postgres(dot)arg(at)gmail(dot)com>
To: Nelson Gonzaga <ngonzaga(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Where pg saves the next OID?
Date: 2009-08-05 15:08:24
Message-ID: f205bb120908050808l511c46e2u4f838f4b6d9b62f6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

2009/8/5 Nelson Gonzaga <ngonzaga(at)yahoo(dot)com>:
> Hi all,
> Where postgresql saves the next OID to be used in any record?
> I need to read it and use in a temporary field (unique) until the user put
> the correct value, I don't want to use sequences because only a few records
> it will be used.
> Now I'm using the current_time function to do it.
> tks,
> Nelson Gonzaga
>

I don't recommend OID. Instead, use CTID.

I don't know for what purposes you need that number, but
ctid is a good option for have a tuple reference.
ctid is like (15,3) (15,4) etc...

If you do select max(ctid) from xxx; you will have the last ctid.

If you put an example of what you want to do, maybe i can
tell you how use this attrib.

--
Emanuel Calvo Franco
www.emanuelcalvofranco.com.ar

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Kenneth Marshall 2009-08-05 23:29:07 error from postgresql 8.4.0 after a dump/restore from 8.3.5
Previous Message Nelson Gonzaga 2009-08-05 11:13:31 Where pg saves the next OID?