From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Use of '&' as table prefix in query
Date: Mon, 12 Jul 2021 11:42:24 -0600
Message-ID: <2dbe6c30-8b16-6b0f-1d93-026ee71b6eae@gmail.com> (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>
On 7/12/21 11:25 AM, Rich Shepard wrote:
> Long ago I wrote a query which was greatly improved (i.e., it actually
> worked as intended) by help here):
>
> /* This query selects all activity information for a named person */
>
> SELECT p.lname, p.fname, p.loc_nbr, p.job_title, p.direct_phone,
> p.active,
> o.org_name,
> l.loc_nbr, l.loc_name,
> a.act_date, a.act_type, a.notes, a.next_contact
> FROM People AS p
> JOIN Organizations AS o ON o.org_nbr = p.org_nbr
> JOIN Locations AS l ON l.org_nbr = o.org_nbr and l.loc_nbr =
> p.loc_nbr
> JOIN Activities AS a ON a.person_nbr = p.person_nbr
> WHERE p.lname = &p.lname AND p.fname = &p.fname;
>
These look like value substitutions, usually done on the client at it
sends the sql. How is this sql getting to the server (presumably after
substitution).
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: robjsargent@gmail.com
Subject: Re: Use of '&' as table prefix in query
In-Reply-To: <2dbe6c30-8b16-6b0f-1d93-026ee71b6eae@gmail.com>
References: <alpine.LNX.2.20.2107121021040.7804@salmo.appl-ecosys.com> <2dbe6c30-8b16-6b0f-1d93-026ee71b6eae@gmail.com>
* 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