pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jonathan Bartlett <johnnyb@eskimo.com>
To: Jean-Christian Imbeault <jc@mega-bucks.co.jp>
Cc: pgsql-general@postgresql.org
Subject: Re: Locking rows
Date: Sat, 1 Mar 2003 05:39:47 -0800 (PST)
Message-ID: <Pine.GSU.4.44.0303010537170.9917-100000@eskimo.com> (raw)
In-Reply-To: <3E602D76.6060204@mega-bucks.co.jp>

>
> No. While I gather the data necessary to print a receipt I mark the
> invoice as non-cancellable.
>

Why don't you have two fields - non-cancellable and printed.

In transaction A, you mark everything you want to print as
non-cancellable.

In transaction B, you query for everything that is not printed AND
non-cancellable, and print it, and then update those same records as being
printed.

In addition, you probably want to turn on the maximum isolation level to
fully prevent rewriting records.

Jon

> In other words, I want to make invoices that have had receipts printed
> no longer cancellable.
>
> Jc
>




view thread (19+ messages)  latest in thread

Message-ID: <Pine.GSU.4.44.0303010537170.9917-100000@eskimo.com>
Permalink:  ../Pine.GSU.4.44.0303010537170.9917-100000@eskimo.com/
Also on:    postgresql.org/message-id/Pine.GSU.4.44.0303010537170.9917-100000@eskimo.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-general@postgresql.org
  Cc: johnnyb@eskimo.com, jc@mega-bucks.co.jp
  Subject: Re: Locking rows
  In-Reply-To: <Pine.GSU.4.44.0303010537170.9917-100000@eskimo.com>
  References: <3E602D76.6060204@mega-bucks.co.jp> <Pine.GSU.4.44.0303010537170.9917-100000@eskimo.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