Re: Use of '&' as table prefix in query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Use of '&' as table prefix in query
Date: 2021-07-12 17:36:40
Message-ID: 2985165.1626111400@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rich Shepard <rshepard(at)appl-ecosys(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jurrie Overgoor 2021-07-12 17:37:30 Re: How to debug a connection that's "active" but hanging?
Previous Message Rich Shepard 2021-07-12 17:25:36 Use of '&' as table prefix in query