From: | "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com> |
---|---|
To: | Jenny - <nat_lazy(at)hotmail(dot)com> |
Cc: | <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: |
Date: | 2003-07-23 19:48:11 |
Message-ID: | Pine.LNX.4.33.0307231346310.22923-100000@css120.ihs.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, 23 Jul 2003, Jenny - wrote:
> Iam trying to acquire rowlevel locks in postgresql. I try doing this:
> 'select * from students where name='Larry' for update;
> But by looking at the holding array of proclock , I've noticed that by doing this only
> AccessShareLock gets acquired which is a table level lock. How do I acquire rowlevelock and
> what fields of Lock or Proclock datastructures indicate it. Thanks Jenny
Hi Jenny, have you read up on the locking methods of postgresql in the
documentation? Since postgresql uses an MVCC locking mechanism, locks in
postgresql aren't really the same as they are in row locking databases
like db2.
If you set the default transaciton isolation mode in postgresql.conf to
serializable, and wrap all your work in transactions, then select for
update should do what you're wanting, but, of course, it's always good to
crank up two psql monitors and actually prove it to yourself. :-)
From | Date | Subject | |
---|---|---|---|
Next Message | Jenny - | 2003-07-23 19:48:19 | this is in plain text (row level locks) |
Previous Message | Larry Rosenman | 2003-07-23 19:38:53 | Re: Feature request -- Log Database Name |