Re: Where pg saves the next OID?

Поиск
Список
Период
Сортировка
От Emanuel Calvo Franco
Тема Re: Where pg saves the next OID?
Дата
Msg-id f205bb120908050808l511c46e2u4f838f4b6d9b62f6@mail.gmail.com
обсуждение исходный текст
Ответ на Where pg saves the next OID?  (Nelson Gonzaga <ngonzaga@yahoo.com>)
Список pgsql-admin
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

В списке pgsql-admin по дате отправления:

Предыдущее
От: Nelson Gonzaga
Дата:
Сообщение: Where pg saves the next OID?
Следующее
От: Kenneth Marshall
Дата:
Сообщение: error from postgresql 8.4.0 after a dump/restore from 8.3.5