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 1m3jCy-0007oX-CK for psycopg@arkaria.postgresql.org; Wed, 14 Jul 2021 18:02:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m3jCx-0001cy-7s for psycopg@arkaria.postgresql.org; Wed, 14 Jul 2021 18:02:07 +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 1m3jCx-0001cq-2C for psycopg@lists.postgresql.org; Wed, 14 Jul 2021 18:02:07 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3jCr-0004FA-07 for psycopg@postgresql.org; Wed, 14 Jul 2021 18:02:06 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id CDE04320077A; Wed, 14 Jul 2021 14:01:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 14 Jul 2021 14:01:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:from:to:references:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=b GPk8HO6tEnEc9UoWzTwZKkEPZWRvJxoPnjIlStjYwY=; b=QKSi0Hr0dkHzEUYgP 7bgsEyc3buLZUH5rJF6cBhOSzScyjUYC4KxxgUrUsJRlampektLElvcQVpxEMZ1m hYZbSEwANFAvHDvAzvp+QZN/pzWAFe711yeSLPekjN7oorgFrr7MW430EczW29Fi 0k/mS3aMZn8jU5N+iz+JAT+ttmPcSiQQPOyv3zU6DpdP4ovDMJu4y+3ekQFcNkbn bQid3HMi8eXKqtHDe+L7Ki2vQxhH3M75UjI4DjpYShsjr8pplCr0POx3FpvOFTgl C9igJQMDy+J4YA9ZFoipWmy3nLo7LSvisVcJygH/H2+NdlbWjPSwd2Jf6ZVg5Mjj mgTRQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=bGPk8HO6tEnEc9UoWzTwZKkEPZWRvJxoPnjIlStjY wY=; b=VwCchL0/J1QtPN/CgDlehhjRpNrn80L0tWQWOKwU9rR/PtCBQ9Nd5C2qM NjSrjxz8tIecPbanMzEBl0+YzqJ194R83RUTS4l7I6UwDue63F3NhyPEgu7iquG+ QKN74y+eHUKetv7HDOmVpAPc6693RGGpf7XZ7I3mnPf4WYP5TsjXm3VEfQwFkOWW spxFqU3Iw2wYKdJY7ZqelXcAFDzBs7mPRyphzhB27gn5CQwVEloWfnH1vUkqSIuU TfVvd6or7oG6BvKRMEQIRlSQpNGfxuxZFzBSEPctbca1mC1sJCoTbQGD9vHUmjoV t9GvAn0yImEszuVG6RNWChvzRrORA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudekgdduudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffhvfhfkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpefhleekveehgeffgfekjeffhfdujeeukeeivefhudeg keelgfefgeevheefieeiteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 14 Jul 2021 14:01:57 -0400 (EDT) Subject: Re: New user questions From: Adrian Klaver To: Rich Shepard , psycopg@postgresql.org References: <36d964b4-e04b-5fdf-9b21-d3bf80a3505d@aklaver.com> <9b477722-71af-abbb-8db7-1390a9906b07@aklaver.com> Message-ID: <5ac3e912-13e7-ced4-9925-be649c240d1b@aklaver.com> Date: Wed, 14 Jul 2021 11:01:56 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 7/14/21 10:57 AM, Adrian Klaver wrote: > On 7/14/21 10:35 AM, Rich Shepard wrote: > This will not work, if for no other reason that 'companies as c on > c.org_nbr = p.org_nbr', etc are not identifiers and it is sql.Identifier. > > Also it would be simpler for this case just to create a quoted > statement, something like: > """SELECT >    fld_1, fld_2, fld_3 > FROM >    some_table AS st > JOIN >    another_table AS a > ON >     st.id = a.a_id > WHERE >     st.fld_1 = 'something' > """ That should have been: st.fld_1 = %s -- Adrian Klaver adrian.klaver@aklaver.com