Re: SELECT FOR SHARE and FOR UPDATE

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Ilja Golshtein <ilejn(at)yandex(dot)ru>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT FOR SHARE and FOR UPDATE
Date: 2005-10-08 02:18:00
Message-ID: 20051008021800.GG36108@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Oct 07, 2005 at 01:18:03PM +0400, Ilja Golshtein wrote:
> Hello!
>
> I want to select data from two tables obtaining
> exclusive lock for records of the first table and
> nonexclusive lock for records of the second one.
>
> In other words, I need something like
> select a.f, b.f from a,b for update of a for share of b.
> Any hints?
>
> Thanks.

>From http://www.postgresql.org/docs/8.0/interactive/sql-select.html:
FOR UPDATE [ OF table_name [, ...] ]

I'm assuming that the syntax is the same for FOR SHARE.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Manish Marathe 2005-10-08 02:21:11 pgsql tests
Previous Message Jim C. Nasby 2005-10-08 01:54:51 Re: PostgreSQL Gotchas