Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: PostgreSQL <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array
Date: 2025-08-06 20:25:59
Message-ID: CANzqJaDOZyyRjNajL4uPbKnbxKjsyFN3UbWYv_9XyTmZ6L-iYA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Puzzling.

I'd do:
pg_dump --schema-only xxx_pub_dev_2_db | grep -i -A5 _sa_setup_role

Note the -i. That _might_ be important.

On Wed, Aug 6, 2025 at 4:18 PM Rumpi Gravenstein <rgravens(at)gmail(dot)com> wrote:

> Just coming back to this. Don't know how to interpret this:
>
> xxx_pub_dev_2_db=# select proname, pronamespace, oid from pg_proc where
> proname like '%sa_setup%';
> proname | pronamespace | oid
> ----------------+--------------+---------
> _sa_setup_role | 7038406 | 7869125
> (1 row)
>
> xxx_pub_dev_2_db=# drop FUNCTION if exists _sa_setup_role;
> DROP FUNCTION
> xxx_pub_dev_2_db=# select proname, pronamespace, oid from pg_proc where
> proname like '%sa_setup%';
> proname | pronamespace | oid
> ---------+--------------+-----
> (0 rows)
>
> xxx_pub_dev_2_db=# 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=#
>
> On Fri, Jul 25, 2025 at 4:52 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
>> Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> writes:
>> > On Fri, 2025-07-25 at 14:10 -0400, Tom Lane wrote:
>> >> So ... any chance you have a data type named _sa_setup_role?
>>
>> > ... it could also be a type "sa_setup_role", and "_sa_setup_role"
>> > is interpreted as the corresponding array type:
>>
>> Oh, of course --- that's a good deal more likely than my version.
>>
>> regards, tom lane
>>
>
>
> --
> Rumpi Gravenstein
>

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2025-08-06 20:43:06 Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array
Previous Message Rumpi Gravenstein 2025-08-06 20:17:36 Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array