pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jean-Christian Imbeault <jc@mega-bucks.co.jp>
To: Doug McNaught <doug@mcnaught.org>
To: pgsql-general@postgreSQL.org
Subject: Re: Locking rows
Date: Sat, 01 Mar 2003 01:49:33 +0900
Message-ID: <3E5F931D.6090509@mega-bucks.co.jp> (raw)
References: <3E5F396F.4090507@mega-bucks.co.jp>
	<m3n0kgs8xy.fsf@varsoon.wireboard.com>

Doug McNaught wrote:
> 
> If you use a single query to generate the rows, this will not be a
> problem.
> 
> If you use multiple queries, execute them all inside a transaction and
> you will get a consistent view of the database.
> 
> No locking needed.

True but what I am worried about is the data changing while I am in a 
transaction.

Right now I want to print customer receipts for items that have been 
ordered. But while I gathering the data, which takes more than one 
query, a customer might come along and cancel an invoice.

In that case I would print a receipt for something that was cancelled.

I need to find a way to avoid this. I thought locking was a way around 
this ... or maybe I need to change my "business" logic or the way the 
app gathers the data?

Jc




view thread (19+ messages)  latest in thread

Message-ID: <3E5F931D.6090509@mega-bucks.co.jp>
Permalink:  ../3E5F931D.6090509@mega-bucks.co.jp/
Also on:    postgresql.org/message-id/3E5F931D.6090509@mega-bucks.co.jp

 · 

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-general@postgresql.org
  Cc: jc@mega-bucks.co.jp, doug@mcnaught.org
  Subject: Re: Locking rows
  In-Reply-To: <3E5F931D.6090509@mega-bucks.co.jp>
  References: <3E5F396F.4090507@mega-bucks.co.jp> <m3n0kgs8xy.fsf@varsoon.wireboard.com> <3E5F931D.6090509@mega-bucks.co.jp>

* 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