Re: Locking rows - Mailing list pgsql-general

From Jonathan Bartlett
Subject Re: Locking rows
Date
Msg-id Pine.GSU.4.44.0303010537170.9917-100000@eskimo.com
Whole thread Raw
In response to Re: Locking rows  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
List 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
>


pgsql-general by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: [ADMIN] Users and groups
Next
From: Detlef Jockheck
Date:
Subject: Re: automatic creation of oid