Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2zrL-00030V-EC for pgsql-general@arkaria.postgresql.org; Mon, 12 Jul 2021 17:36:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m2zrK-0002IT-5d for pgsql-general@arkaria.postgresql.org; Mon, 12 Jul 2021 17:36:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2zrJ-0002IL-T2 for pgsql-general@lists.postgresql.org; Mon, 12 Jul 2021 17:36:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2zrH-0001Vv-Ku for pgsql-general@lists.postgresql.org; Mon, 12 Jul 2021 17:36:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 16CHaerc2985166; Mon, 12 Jul 2021 13:36:40 -0400 From: Tom Lane To: Rich Shepard cc: pgsql-general@lists.postgresql.org Subject: Re: Use of '&' as table prefix in query In-reply-to: References: Comments: In-reply-to Rich Shepard message dated "Mon, 12 Jul 2021 10:25:36 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2985164.1626111400.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 12 Jul 2021 13:36:40 -0400 Message-ID: <2985165.1626111400@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Rich Shepard 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 =3D &p.lname AND p.fname =3D &p.fname; > I did not save the reason why the ampersand is used in the WHERE row sel= ection > phrase and want now to learn why it's there. Probably needed to concaten= ate > 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