psql variables in the DO command - Mailing list pgsql-general

From Pavel Luzanov
Subject psql variables in the DO command
Date
Msg-id 5bae153c-ade4-ad24-bd46-857993240cfd@postgrespro.ru
Whole thread Raw
Responses Re: psql variables in the DO command  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
Hello,

I can't use psql variable in the DO command. Is it intentional behavior?

postgres=# \set var 'Hello, World!'

postgres=# do $$begin raise notice '%', :'var'; end;$$;

ERROR:  syntax error at or near ":"

LINE 1: do $$begin raise notice '%', :'var'; end;$$;

                                      ^


-- 

-----
Pavel Luzanov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company



pgsql-general by date:

Previous
From: Łukasz Jarych
Date:
Subject: Requiring pass and database psql shell command
Next
From: James Keener
Date:
Subject: Re: Requiring pass and database psql shell command