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 1m2zwt-0003Cs-P1 for pgsql-general@arkaria.postgresql.org; Mon, 12 Jul 2021 17:42:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m2zws-0001rd-Di for pgsql-general@arkaria.postgresql.org; Mon, 12 Jul 2021 17:42:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2zws-0001rU-2u for pgsql-general@lists.postgresql.org; Mon, 12 Jul 2021 17:42:30 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m2zwp-0004Vj-Il for pgsql-general@lists.postgresql.org; Mon, 12 Jul 2021 17:42:29 +0000 Received: by mail-oi1-x22c.google.com with SMTP id t25so6608898oiw.13 for ; Mon, 12 Jul 2021 10:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=SaaManLI1t7Ji4EtVPI5VlC4p/32vN3tvYCVhwfSH5Q=; b=HZ8n+u9A+qgrjffnEBui6k7eKucekqQ6et7MM7lISsCI/v2+QgwRxIs+NmLXqa6dd1 zeqWKd5UvYbdK1in2PAwRqmLWxt9wuOAY4vbFrAr8lddswJ7GwUwNYp5FU3mlBZB2ebO RTNkwrjg5UQslW2MwB/8BBVpXgwmtCYS/cACjpj+a4MyEwgNX/nh23x+bOMpBwqEkcIk paA/cxhIZnP6SIh4u0g7pvqLvxIJqwMWp/4/i9L0WWGrVjQc7WIacXVytQDbWp3DkdKA 3I2Jd6PtaQSa8QWPF1SlDe7RY1m+GgR/mxP7p6UsBizYZ3XM4I08Q/Y7uRN1wL6XlEoo 5wxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=SaaManLI1t7Ji4EtVPI5VlC4p/32vN3tvYCVhwfSH5Q=; b=dQiAEFLOrRb5h9fYgOelyK40CQLzI5567Z0ZWg0fnYMyMH5TLz+IJ5xnM0PsHWxVb1 reTovapy7G5mTzm8iXFM2ZQ3QcVcDfpYmGIGgCwlayAkHq3kBac6tgE4b5U1/i7gF1hY WREcyjGejGFv657Farcyo1v+TtPmqIGVr9lnlc/e39P5SayKLroURT7G9IcaHIS76Ev6 6X86SmpxDsl0GZRa9YvS/pUm+KnNItTZ6t2sKwOHPAN/kUXubpuR0UWCmAeaK68jKN3X bUgGr/Zl7lcmq95dpjRGkYO6bu/XNX6vjAepO9N3n97S2AgZhCnC21T0j/AyqlUjK2iQ Dlew== X-Gm-Message-State: AOAM5334CPxwoeJnbV3TfucdMuDqT+Z+UV9Yb1qh+IhXUkdmr+IOsJyZ 4Im4QWEsFy539csaA4LbgqTzJSxTR+E= X-Google-Smtp-Source: ABdhPJysTBiauZmWWShu/zNz4QwEv5GhhaJe3fLdpwA9w/PgtM2ml6b0puISQi5M1+aWBUbu5pJgjg== X-Received: by 2002:a05:6808:3d0:: with SMTP id o16mr17148932oie.13.1626111745277; Mon, 12 Jul 2021 10:42:25 -0700 (PDT) Received: from ?IPv6:2601:681:5500:dde0:d1eb:6a44:8bdb:13a5? ([2601:681:5500:dde0:d1eb:6a44:8bdb:13a5]) by smtp.gmail.com with ESMTPSA id a44sm2615372ooj.12.2021.07.12.10.42.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Jul 2021 10:42:25 -0700 (PDT) Subject: Re: Use of '&' as table prefix in query To: pgsql-general@lists.postgresql.org References: From: Rob Sargent Message-ID: <2dbe6c30-8b16-6b0f-1d93-026ee71b6eae@gmail.com> Date: Mon, 12 Jul 2021 11:42:24 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-CA List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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).