pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Flavio Suguimoto <flavio.suguimoto@pragyatechnologies.com>
To: pgsql-sql@postgresql.org
Subject: Locking row
Date: Fri, 10 Mar 2006 17:50:10 -0300
Message-ID: <GFEGIFLJJCMGLBLAHILKEEDECGAA.flavio.suguimoto@pragyatechnologies.com> (raw)
In-Reply-To: <20060310173113.GA8935@wolff.to>

Hi all,

I need to mark a row with a value in a column, but first i need to select
the first row without this mark. But in some concurrents cases i mark the
row twice. How can i lock the row to avoid others session get it?

TABLE TICKET
TICKET_NUMBER | MARK
        00001 |    1
        00002 |    0

I need to select the first row with 0 in MARK column and then mark it with
1.

regards,
Flavio Suguimoto




view thread (3+ messages)  latest in thread

Message-ID: <GFEGIFLJJCMGLBLAHILKEEDECGAA.flavio.suguimoto@pragyatechnologies.com>
Permalink:  ../GFEGIFLJJCMGLBLAHILKEEDECGAA.flavio.suguimoto@pragyatechnologies.com/
Also on:    postgresql.org/message-id/GFEGIFLJJCMGLBLAHILKEEDECGAA.flavio.suguimoto@pragyatechnologies.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: flavio.suguimoto@pragyatechnologies.com
  Subject: Re: Locking row
  In-Reply-To: <GFEGIFLJJCMGLBLAHILKEEDECGAA.flavio.suguimoto@pragyatechnologies.com>
  References: <20060310173113.GA8935@wolff.to> <GFEGIFLJJCMGLBLAHILKEEDECGAA.flavio.suguimoto@pragyatechnologies.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox