pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Luzanov <p.luzanov@postgrespro.ru>
To: pgsql-general@lists.postgresql.org
Subject: psql variables in the DO command
Date: Mon, 5 Mar 2018 16:13:16 +0300
Message-ID: <5bae153c-ade4-ad24-bd46-857993240cfd@postgrespro.ru> (raw)

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





view thread (11+ messages)  latest in thread

Message-ID: <5bae153c-ade4-ad24-bd46-857993240cfd@postgrespro.ru>
Permalink:  ../5bae153c-ade4-ad24-bd46-857993240cfd@postgrespro.ru/
Also on:    postgresql.org/message-id/5bae153c-ade4-ad24-bd46-857993240cfd@postgrespro.ru

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: p.luzanov@postgrespro.ru
  Subject: Re: psql variables in the DO command
  In-Reply-To: <5bae153c-ade4-ad24-bd46-857993240cfd@postgrespro.ru>
  References: <5bae153c-ade4-ad24-bd46-857993240cfd@postgrespro.ru>

* 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