pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: gack@verizon.net
To: pgsql-sql@postgresql.org
Subject: locks and variable substitution
Date: Fri, 25 Jul 2003 13:49:12 -0500
Message-ID: <20030725184912.HHCX20032.out005.verizon.net@localhost> (raw)

Is it possible to do variable substitution with explicit locks in plpgsql? 
Something along the lines of

...

declare
big_string alias for $1;
excl_table text;

begin
--assuming big_string starts with something like table=table1!
excl_table := substr(big_string,7,(position(''!'' in big_string)-7));

lock table excl_table in exclusive mode;

...

Thanks very much.
g.






view thread (2+ messages)  latest in thread

Message-ID: <20030725184912.HHCX20032.out005.verizon.net@localhost>
Permalink:  ../20030725184912.HHCX20032.out005.verizon.net@localhost/
Also on:    postgresql.org/message-id/20030725184912.HHCX20032.out005.verizon.net@localhost

 · 

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: gack@verizon.net
  Subject: Re: locks and variable substitution
  In-Reply-To: <20030725184912.HHCX20032.out005.verizon.net@localhost>

* 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