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 1mxz2b-00042r-30 for pgsql-general@arkaria.postgresql.org; Thu, 16 Dec 2021 22:15:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mxz2Z-0003Ku-SD for pgsql-general@arkaria.postgresql.org; Thu, 16 Dec 2021 22:15:55 +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 1mxz2Y-0003KL-6j for pgsql-general@lists.postgresql.org; Thu, 16 Dec 2021 22:15:55 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxz2Q-0007JR-8P for pgsql-general@lists.postgresql.org; Thu, 16 Dec 2021 22:15:53 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 99AED5C01A6; Thu, 16 Dec 2021 17:15:43 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 16 Dec 2021 17:15:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=H UWKOQPXxTvDYrKpfotB7zFpDY9NID2gNz0Cbils2Jk=; b=VkVfUkdveiEDsLncR o6zGm9jZNwSOpwEYvE8b1lpmM8Rxw6dTNEdNMZVks2ZzRYWcfcbbaAVa/kx6V30g B4PiC+C7RTvW64e1057XBIstRV5rvm2T7dWATl9j0QmPhqI88vJT+pRWPcRWMfyA pvocTeErNx3SoK8VCb+RtEGvy1pUzfrH6PkUAXybPFpnheBfKHlkztkRr6u1eLxX 7iQh5jeAQ9r5lxntQgdkkoVzsIvck9JYvCS6UvAcBVRpUAAU0HXWyY3toGS2qIet 3AbVURvuddpMmtblNktL5yhOUj+1Ds2wmqs3UbpSg5VLVLlpnwUK5k0gYFGMS8+g EvpZw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=fm1; bh=HUWKOQPXxTvDYrKpfotB7zFpDY9NID2gNz0Cbils2 Jk=; b=HB+sCRsiRc8dLWkmdjHL0KQi7nJAdLY9kQT7Iix1/r/PWWjPs3cBL8/g4 AcBpPpLq1DfEoCIbe+OUL5+tE+bsrap88Yd99QlC45YWTzoc+yx6wts/wm6Bj+hh xLlbgKvAllq7EWR2fAfS0u8rOu+U8Ian4bpN3lfTabqTey+nU3Nuwd4dOzh6iKeU fveOsN9yrOmupJRFsllgQ9ETLKFPb8k5uryAN5UPysSNEUoeneB7FtMiLHOgSQud DSqCaObWYOd2yNbZE783wOrCs5/S4ypZTtgc/3/vvGOGaqa9eteuX48tBehcvFSU LrmeYbyttw1vjv6z/HDud+KVJC7Pw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrleeggdduiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpedugfeuleegveffhfegleejhefhtedtgeeileeggfeh fefffeevgeejtdeutefftdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Dec 2021 17:15:42 -0500 (EST) Message-ID: <3d76aa2d-0e1e-8cff-49de-93be10a2a5ea@aklaver.com> Date: Thu, 16 Dec 2021 14:15:42 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: How to ensure column names are double quoted while using execute format when building a stored procedure? Content-Language: en-US To: "David G. Johnston" Cc: Shaozhong SHI , pgsql-general References: From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/16/21 14:11, David G. Johnston wrote: > On Thu, Dec 16, 2021 at 3:04 PM Adrian Klaver > wrote: > > > This: > > 'count of nulls in "UNIQUE_REFERENCE_NUMBER"' > > is just plain incorrect syntax. > > > count of nulls in quote>UNIQUE_REFRENCE_NUMBER > > That is not invalid syntax.  It is just literal single quoted text - the > double quotes are simply characters in the string. Alright I took it to be what followed: count("""UNIQUE_REFERENCE_NUMBER"""). Now I see it is a tag for the count. > > David J. > -- Adrian Klaver adrian.klaver@aklaver.com