pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Zac <zaccheob@inwind.it>
Cc: pgsql-sql@postgresql.org
Subject: Re: Help on Procedure running external function
Date: Tue, 5 Jul 2005 07:39:48 -0500
Message-ID: <20050705123948.GB11379@wolff.to> (raw)
In-Reply-To: <dads28$289m$1@news.hub.org>
References: <opsteqmfbkawcxfg@adi>
	<dabb6g$7k9$1@news.hub.org>
	<opstevy1lkawcxfg@adi>
	<dabkio$1alj$1@news.hub.org>
	<opstgfj3k4awcxfg@adi>
	<dads28$289m$1@news.hub.org>

On Tue, Jul 05, 2005 at 13:47:24 +0200,
  Zac <zaccheob@inwind.it> wrote:
> I think you should use 'FOR UPDATE' clause in your first "select":
> 
> select into vnrBon maxnrbon+1 from MagMaxNrBon where magazie = 
> dsgroup.magazie_implicita_lansare FOR UPDATE;
> 
> In this way you lock the rows eventually returned and no one can update 
> them (or select them "for update") until your transaction finished.

That doesn't work because you don't lock rows which aren't in the table
yet. You need to use a lock table instead.



view thread (11+ messages)  latest in thread

Message-ID: <20050705123948.GB11379@wolff.to>
Permalink:  ../20050705123948.GB11379@wolff.to/
Also on:    postgresql.org/message-id/20050705123948.GB11379@wolff.to

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bruno@wolff.to, zaccheob@inwind.it
  Subject: Re: Help on Procedure running external function
  In-Reply-To: <20050705123948.GB11379@wolff.to>

* 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