Обсуждение: Where pg saves the next OID?

Поиск
Список
Период
Сортировка

Where pg saves the next OID?

От
Nelson Gonzaga
Дата:
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




Veja quais são os assuntos do momento no Yahoo! + Buscados: Top 10 - Celebridades - Música - Esportes

Re: Where pg saves the next OID?

От
Emanuel Calvo Franco
Дата:
2009/8/5 Nelson Gonzaga <ngonzaga@yahoo.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