docs: psql and variable interpolation

From: Philippe Beaudoin <philippe(dot)beaudoin(at)dalibo(dot)com>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: docs: psql and variable interpolation
Date: 2020-07-13 13:09:13
Message-ID: bbfcd891-c0d0-c342-3573-1f913af65109@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Hi all,

I recently used the nice variable capabilities in psql, after having
read the "SQL Interpolation" chapter in the psql page
(https://www.postgresql.org/docs/12/app-psql.html).

But I spent a lot of time trying to understand why using a variable in a
\copy command failed ... until a colleague of mine showed me this was
actually written elsewhere in the documentation (formerly in the \copy
chapter).

The first sentence of this SQL interpolation chapter says "A key feature
of psql variables is that you can substitute (“interpolate”) them into
regular SQL statements, as well as the arguments of meta-commands." But
nothing in this chapter indicates that there are exceptions.

May be we could have a wording adjustment with something like : "A key
feature of psql variables is that you can substitute (“interpolate”)
them into regular SQL statements, as well as the arguments of
meta-commands (unless specifically noted)."

Regards. Philippe.

------------------------------------------------------------------------
<https://www.dalibo.com/>
*DALIBO*
*L'expertise PostgreSQL*
43, rue du Faubourg Montmartre
75009 Paris *Philippe Beaudoin*
*Consultant Avant-Vente*
+33 (0)1 84 72 76 11
+33 (0)7 69 14 67 21
philippe(dot)beaudoin(at)dalibo(dot)com
Valorisez vos compétences PostgreSQL, certifiez-vous chez Dalibo
<https://certification.dalibo.com/> !

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Stephen Frost 2020-07-13 13:13:42 Re: Default setting for enable_hashagg_disk
Previous Message Daniel Gustafsson 2020-07-13 12:24:43 Re: Additional Chapter for Tutorial