locks and variable substitution

Поиск
Список
Период
Сортировка
Искать

locks and variable substitution

От:
<gack@verizon.net>
Дата:
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.




Re: locks and variable substitution

От:
Eric Clark <eclark@zerohp.com>
Дата:
On Fri, 2003-07-25 at 11:49, gack@verizon.net wrote:
> 
> lock table excl_table in exclusive mode;

That probably wont work, but this will:

EXECUTE ''LOCK TABLE ''   || quote_ident(excl_table) || '' IN EXCLUSIVE MODE'';

Eric


FAQ