Re: prepare, execute & oids

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: prepare, execute & oids
Дата
Msg-id 20060802073850.GB29699@svana.org
обсуждение исходный текст
Ответ на Re: prepare, execute & oids  (phazon <phazon.ml@gmail.com>)
Список pgsql-general
On Wed, Aug 02, 2006 at 09:25:43AM +0200, phazon wrote:
> When I make juste a simple insert like
>
> Insert Into my_table (my_field) values ('value')
>
> I get back the OID of the inserted line.

You really don't want to use OID, you want a sequence. (Hint: OIDs are
not really unique, not a primary key).

> I can't use the curval of a sequence because it can be the value of another
> insert made by another user.

currval() is the last value in *your current session*. It won't be
affected by other users.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: "Christian Rengstl"
Дата:
Сообщение: Re: Strange error message
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Strange error message