Re: INSERT ... RETURNING as Oracle

Поиск
Список
Период
Сортировка
От Martin A. Marques
Тема Re: INSERT ... RETURNING as Oracle
Дата
Msg-id Pine.LNX.4.10.10103051021150.1796-100000@math.unl.edu.ar
обсуждение исходный текст
Ответ на Re: INSERT ... RETURNING as Oracle  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Re: INSERT ... RETURNING as Oracle
Список pgsql-general
On Sun, 4 Mar 2001, Peter Eisentraut wrote:

> > If I use at first the INSERT, and after SELECT MAX(ID), the result will be
> > uncertain.
>
> If you are worried about other transactions getting in the way then you
> should do SET TRANSACTION ISOLATION LEVEL SERIABLIZABLE.

I have some uncertainty about somethings that I've read from the FAQ.

If I have a client INSERT a value in a table (all happens inside a BEGIN
WORK ---- COMMIT WORK), which has a SERIAL column, and I want to
reference that serial value on another INT column which is a foreign key
of that SERIAL. Using currval() function will give me exact value as the
FAQs say, and why? Is it the transaction that makes this work this way?

Saludos... :-)

System Administration: It's a dirty job,
but someone told I had to do it.
-----------------------------------------------------------------
Martín Marqués            email:     martin@math.unl.edu.ar
Santa Fe - Argentina        http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------


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

Предыдущее
От: Juan Ramón Cortabitarte
Дата:
Сообщение: RE: [PHP] How to connect to PostgreSQL with phpPgAdmi
Следующее
От: "Anthony E . Greene"
Дата:
Сообщение: Re: postmaster confiugration and hardware configuration