Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ufMsZ-006IAD-Lw for pgsql-general@arkaria.postgresql.org; Fri, 25 Jul 2025 18:10:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ufMsX-003kFX-HF for pgsql-general@arkaria.postgresql.org; Fri, 25 Jul 2025 18:10:45 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ufMsX-003kFO-6j for pgsql-general@lists.postgresql.org; Fri, 25 Jul 2025 18:10:45 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ufMsU-000onK-0P for pgsql-general@lists.postgresql.org; Fri, 25 Jul 2025 18:10:45 +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 56PIAeMh1943138; Fri, 25 Jul 2025 14:10:40 -0400 From: Tom Lane To: Rumpi Gravenstein cc: PostgreSQL Subject: Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array In-reply-to: <1940680.1753465819@sss.pgh.pa.us> References: <1934172.1753462470@sss.pgh.pa.us> <1936547.1753463422@sss.pgh.pa.us> <1940680.1753465819@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 25 Jul 2025 13:50:19 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1943136.1753467040.1@sss.pgh.pa.us> Date: Fri, 25 Jul 2025 14:10:40 -0400 Message-ID: <1943137.1753467040@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > Well, there's got to be *something* different about that database. After looking at the code I remembered that the parser might be taking this as a type coercion request. With that idea, I can duplicate the observed behavior like so: regression=# select _sa_setup_role('af_repo_app'); INFO: af_repo_app _sa_setup_role ---------------- Done (1 row) regression=# create domain _sa_setup_role as varchar[]; CREATE DOMAIN regression=# select _sa_setup_role('af_repo_app'); ERROR: malformed array literal: "af_repo_app" LINE 1: select _sa_setup_role('af_repo_app'); ^ DETAIL: Array value must start with "{" or dimension information. So ... any chance you have a data type named _sa_setup_role? regards, tom lane