Re: ISOLATION LEVEL SERIALIZABLE
От
Fernando Schapachnik
Тема
Re: ISOLATION LEVEL SERIALIZABLE
Дата
Msg-id
20020326170626.J47521@ns1.via-net-works.net.ar
Ответ на
Re: ISOLATION LEVEL SERIALIZABLE (power2themacs)
Список
Дерево обсуждения
ISOLATION LEVEL SERIALIZABLE power2themacs <power2themacs@yahoo.com>
Re: ISOLATION LEVEL SERIALIZABLE Darren Ferguson <darren@crystalballinc.com>
Re: ISOLATION LEVEL SERIALIZABLE power2themacs <power2themacs@yahoo.com>
Re: ISOLATION LEVEL SERIALIZABLE Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: ISOLATION LEVEL SERIALIZABLE Fernando Schapachnik <fschapachnik@vianetworks.com.ar>
Re: ISOLATION LEVEL SERIALIZABLE Jason Earl <jason.earl@simplot.com>
Re: ISOLATION LEVEL SERIALIZABLE power2themacs <power2themacs@yahoo.com>
En un mensaje anterior, power2themacs escribió:
> >In table two you would not create a serial instead you would create an
> >INTEGER because serial is a counter and the values in table 2 may not be
> >in table 1.
> >
> >Use a transaction like as follows
> >
> >BEGIN;
> >INSERT INTO TABLE1 VALUES (Whatever values);
> >var = SELECT CURRVAL('sequence_name');
> >INSERT INTO TABLE2 VALUES (var,whatever else);
> >COMMIT;
> >
>
> But this is the race condition I am trying to avoid. Someone can
If you are in a trasaction, the RDBMS guarantees that your statements
executes as if their where the only ones (ie, as in a serial
execution). No race condition there.
Regards.
Fernando P. Schapachnik
fschapachnik@vianetworks.com.ar
В списке pgsql-general по дате отправления