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 1nbjtE-00026W-Tj for pgsql-admin@arkaria.postgresql.org; Tue, 05 Apr 2022 14:10:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nbjtD-0000Tq-ON for pgsql-admin@arkaria.postgresql.org; Tue, 05 Apr 2022 14:10:35 +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 1nbjtD-0000Th-Dt for pgsql-admin@lists.postgresql.org; Tue, 05 Apr 2022 14:10:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbjtB-0002NL-8R for pgsql-admin@lists.postgresql.org; Tue, 05 Apr 2022 14:10:35 +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 235EAUil2358039; Tue, 5 Apr 2022 10:10:30 -0400 From: Tom Lane To: "David G. Johnston" cc: sagar jadhav , Nikhil Ingale , "pgsql-admin@lists.postgresql.org" Subject: Re: failed to execute the psql case statement which has the function call. In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Tue, 05 Apr 2022 06:53:15 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2358037.1649167830.1@sss.pgh.pa.us> Date: Tue, 05 Apr 2022 10:10:30 -0400 Message-ID: <2358038.1649167830@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > But the error fragment shown suggests that the query shouldn't be expecting > a column name (contrary to my earlier point), so we are back to having to > see the entire function definition (or a reproducible example) to provide > an answer. Spelling typo comes to mind. I'm wondering if there's an actual function involved at all. Maybe the OP is just writing this in a psql script and wanting to substitute a psql variable. In that case something like :'variable' might be the solution. Bottom line is the same though: we need to see a lot more context than we've been shown. regards, tom lane