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 1ujkyy-00Bett-Ei for pgsql-general@arkaria.postgresql.org; Wed, 06 Aug 2025 20:43:32 +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 1ujkyw-0018AP-JG for pgsql-general@arkaria.postgresql.org; Wed, 06 Aug 2025 20:43:30 +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 1ujkyw-0017q5-6P for pgsql-general@lists.postgresql.org; Wed, 06 Aug 2025 20:43:30 +0000 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1ujkyr-00187Z-19 for pgsql-general@lists.postgresql.org; Wed, 06 Aug 2025 20:43:27 +0000 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-741aeba62ccso113859a34.0 for ; Wed, 06 Aug 2025 13:43:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754513003; x=1755117803; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KAnVwLlRCUeE10q9qCELSdP+17XWlJ3jsLsA67q9sjE=; b=E4RF3TFT6v5E6KaGb/qSPu1139nxaqiChf4rZI57qsfopDyApp4NLIlV0LrZ3F/ziT iW0g97jGB5GMO2POqS+91ev5FdlRsxmA/IAJR/nhGacAtiEqMQwdVaaEUXoc/E8XwYO/ BUMA6W+hSz9Jk8v1Z5NxZZrILYrHfHW2A4XQVTznKGTYhVfqwIL3RWFxPlQxUag7udTa WsaPEyL+vS2lFqmO3fH9FHgTd1Pq96yjZ39BRkftzCoyA/sdcL/qXgjsnwQ1GlwEGa6n 9URK0X33wclh/NV09V/In0VoyaJEeKnpvpzKVCbR86B0kfRC2cxgWrfx9eKRM9+W13Od +CVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754513003; x=1755117803; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KAnVwLlRCUeE10q9qCELSdP+17XWlJ3jsLsA67q9sjE=; b=YolMM/MCy5EL/TTgzYeReRN4KegaXbMf0L7pDOG0Op7fXagZKaj6vm0n/VysyglWyN Nm1W+AaEHto9J+89m/+5xyXZDZyye5UTMCb5CdkFjQ4B5coRSq8+05ZTp0ItHtmN1AOx xqc45sbLdNSr6Sy2mdS1apqpCfNgRjW4hQ0nbwCC+WClQTSQUcxe42GPbCmiUgwv5ynN 3BG7ZbF4Py5FXtDhvQ/tSEEbN2u25SB7/Y01Vz1FipQDV5+SlUaxG4UPyY3MOgjG6H3n p9ndUH9W9NL+zweb0kYAKDWMMkghVF7y5q2WOK+nEfZbOsFzGmEmp6bp5/2mPGYwosI6 3BIw== X-Forwarded-Encrypted: i=1; AJvYcCUJsk/Pee199lNW1Wh+jcbGG1ZD8LYGQI0q2mX0SmLY5reFzzbGx/MJIioy7YOsYwkFpJJBWTxmInEPBWrq@lists.postgresql.org X-Gm-Message-State: AOJu0Yy/SbrDAUYLs9JrTp9txiL9unF+QE0c6iVb+mIqIq7BEPn8v2pb hKVv2ujJWRQObB5eUQLd2VXcNx6g6+Ruxic7uFZG8snQpGerMW84rIig/0cNyhkGZShbtIuWQWi lVRmPsmeieZL34nJaAviHFIixPlLoszo= X-Gm-Gg: ASbGncv4gNXPVjTe5uqM6TZLl7fQbF6yUsM0gauua4TlrA2qsBYIDHX8lO29RmATeZz +1ye0OCas0L7vzYTgGlxFpImYOC4Ud1Gxn0Jc+ZJZssOUMqfFu+8KyOBTJD2C4akNHdYzRECzvd 0WlWbQCFG8GKw4NXBoEi1exHEwz5ps/40U7tc9vdYWO8LyBw5jcUy9AJ3E4Zpctgvex3Y5ULZg+ bAqe1ad4Ly0xDCr4AL1aJW1qlPxM/gfFZLtI3a3 X-Google-Smtp-Source: AGHT+IH21tcAyhEUvhbVuwcJrRfC/93CnawL7g/ygrydKOREbohDKOrhjvrJ0fY2TL/Fyz+WwPty09GgsEFIprOfqQE= X-Received: by 2002:a05:6830:43a8:b0:742:fefe:4311 with SMTP id 46e09a7af769-74308ecafefmr3362255a34.16.1754513003169; Wed, 06 Aug 2025 13:43:23 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a8a:5e6:0:b0:5dc:d940:7893 with HTTP; Wed, 6 Aug 2025 13:43:22 -0700 (PDT) In-Reply-To: References: <1934172.1753462470@sss.pgh.pa.us> <1936547.1753463422@sss.pgh.pa.us> <1940680.1753465819@sss.pgh.pa.us> <1943137.1753467040@sss.pgh.pa.us> <2223785.1753476729@sss.pgh.pa.us> From: "David G. Johnston" Date: Wed, 6 Aug 2025 13:43:22 -0700 X-Gm-Features: Ac12FXxpj24mDlJnYnpjVNseMqXwJvWfjYvCRtVMVK_PQ73WGE8nH-laLlylPoM Message-ID: Subject: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array To: Rumpi Gravenstein Cc: Tom Lane , Laurenz Albe , PostgreSQL Content-Type: multipart/alternative; boundary="0000000000004ed0ba063bb8644b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004ed0ba063bb8644b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wednesday, August 6, 2025, Rumpi Gravenstein wrote: > > xxx_pub_dev_2_db=3D# drop FUNCTION if exists _sa_setup_role; > DROP FUNCTION > xxx_pub_dev_2_db=3D# select proname, pronamespace, oid from pg_proc where > proname like '%sa_setup%'; > proname | pronamespace | oid > ---------+--------------+----- > (0 rows) > > xxx_pub_dev_2_db=3D# 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. > xxx_pub_dev_2_db=3D# > Yeah, we=E2=80=99ve already pretty much decided this function has nothing t= o do with it. Go look at pg_type per the last example demonstrating the same error without the involvement of any user-defined function. David J. --0000000000004ed0ba063bb8644b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wednesday, August 6, 2025, Rumpi Gravenstein <rgravens@gmail.com> wrote:

xxx_pub_dev_2_db=3D# drop FU= NCTION if exists _sa_setup_role;
DROP FUNCTION
xxx_pub_dev_2_db=3D# s= elect proname, pronamespace, oid from pg_proc where proname like '%sa_s= etup%';
proname | pronamespace | oid
---------+--------------+---= --
(0 rows)
=C2=A0
xxx_pub_dev_2_db=3D# select _sa_setup_role('= ;af_repo_app');
ERROR: =C2=A0malformed array literal: "af_repo_= app"
LINE 1: select _sa_setup_role('af_repo_app');
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 ^
DETAIL: =C2=A0Array value must start with = "{" or dimension information.
xxx_pub_dev_2_db=3D#

Yeah, we=E2=80=99ve already pretty much decided = this function has nothing to do with it.=C2=A0 Go look at pg_type per the l= ast example demonstrating the same error without the involvement of any use= r-defined function.

David J.

<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex">
--0000000000004ed0ba063bb8644b--