Re: Locking rows

From: Jonathan Bartlett <johnnyb(at)eskimo(dot)com>
To: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Locking rows
Date: 2003-03-01 13:39:47
Message-ID: Pine.GSU.4.44.0303010537170.9917-100000@eskimo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> 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
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jan Gravgaard 2003-03-01 16:48:25 Re: Warning: Supplied argument is not a valid PostgreSQL link resource
Previous Message Oliver Elphick 2003-03-01 13:02:01 Re: Users and groups