From: | Vadim Mikheev <vadim(at)krs(dot)ru> |
---|---|
To: | Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | Juan Alvarez Ferrando <juan(at)suzuki(dot)es>, PostgreSQL-development <hackers(at)postgreSQL(dot)org> |
Subject: | Re: [HACKERS] Re: Beta test of Postgresql 6.5 |
Date: | 1999-01-20 12:50:56 |
Message-ID: | 36A5D130.5DED8EDF@krs.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Bruce Momjian wrote:
>
> >
> > Hi again,
> >
> > I'm trying to use your hint, but I don't find the new select sintax in the
> > docs, so excuse me for asking again.
> > If I've got it right, whe I make a SELECT ... FOR UPDATE within a connection
> > (Autocommit = off), the selected records are blocked until the connection is
> > closed, commited or rolled-back. Thus, only the same transaction can modify
> > them, and consistency is thus achieved.
> >
> > I've tried lauching two processes that make simultaneous updates on one
> > table (different rows) and simultaneous inserts on another (these processes
> > are client order imports from file). One of the processes run while the
> > other kept waiting in the first insert it atempted. Do I have to use any SQL
> > or configure something, or is this the normal behaviour?
> >
> > Thanks again for your answers.
Only syntax is implemented currently.
Please wait for 1-2 days.
> I assume you are running the snapshot, and not 6.4.*. You are actually
> using FOR UPDATE, so I think it is the snapshot.
>
> This is normal behavior, I think. I believe the issue with SELECT FOR
> UPDATE is that it has to lock the entire table. We allow non-blocking
> readers and non-blocking writers on different rows by using the
> transaction id and multi-version system. SELECT FOR UPDATE does not
> actually modify any rows, so we can't look at any transaction id.
FOR UPDATE modifies rows.
It changes t_xmax and sets HEAP_MARKED_FOR_UPDATE
flag in t_infomask.
BTW, I think that MVCC stuff will not be ready
for beta testing 1 Feb...
Vadim
From | Date | Subject | |
---|---|---|---|
Next Message | D'Arcy J.M. Cain | 1999-01-20 13:52:25 | Patches |
Previous Message | Bruce Momjian | 1999-01-20 11:09:21 | Re: Beta test of Postgresql 6.5 |