From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rich Shepard <rshepard@appl-ecosys.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Use of '&' as table prefix in query
Date: Mon, 12 Jul 2021 13:36:40 -0400
Message-ID: <2985165.1626111400@sss.pgh.pa.us> (raw)
In-Reply-To: <alpine.LNX.2.20.2107121021040.7804@salmo.appl-ecosys.com>
References: <alpine.LNX.2.20.2107121021040.7804@salmo.appl-ecosys.com>
Rich Shepard <rshepard@appl-ecosys.com> writes:
> Long ago I wrote a query which was greatly improved (i.e., it actually
> worked as intended) by help here):
> SELECT ...
> WHERE p.lname = &p.lname AND p.fname = &p.fname;
> I did not save the reason why the ampersand is used in the WHERE row selection
> phrase and want now to learn why it's there. Probably needed to concatenate
> separate names?
AFAICS this is invoking a prefix operator named "&". There is no such
operator built into Postgres. Maybe psql's "\do+ &" would jog your
memory about where yours came from.
regards, tom lane
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: tgl@sss.pgh.pa.us, rshepard@appl-ecosys.com
Subject: Re: Use of '&' as table prefix in query
In-Reply-To: <2985165.1626111400@sss.pgh.pa.us>
References: <alpine.LNX.2.20.2107121021040.7804@salmo.appl-ecosys.com> <2985165.1626111400@sss.pgh.pa.us>
* 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