public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrian Klaver <[email protected]>
To: Rumpi Gravenstein <[email protected]>
To: Tom Lane <[email protected]>
Cc: Laurenz Albe <[email protected]>
Cc: PostgreSQL <[email protected]>
Subject: Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array
Date: Wed, 6 Aug 2025 13:43:06 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAEpg1wBUcKjbM+vqP=JLHQUCOW9ct=aVRo1gBEtAZ5SuMY6cYQ@mail.gmail.com>
References: <CAEpg1wBxp=25isxj6yt2cf97KtvbwxvJfrJ9qYF8UQxGSBJ93Q@mail.gmail.com>
	<[email protected]>
	<CAEpg1wCDL+iYbG7ByjHcgfvJy7m3m-rDp-xKiYovvxeKTbG7iQ@mail.gmail.com>
	<[email protected]>
	<CAEpg1wALRocK=uDSNyJqdc=vhNGjYFmT3H_TNzihSOMS88WHfg@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAEpg1wBUcKjbM+vqP=JLHQUCOW9ct=aVRo1gBEtAZ5SuMY6cYQ@mail.gmail.com>



On 8/6/25 1:17 PM, Rumpi Gravenstein 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');

Do you have a custom type named sa_setup_role?

In psql do:

\dT

or

select * from pg_type where typname = 'sa_setup_role';

>                                ^
> 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 <[email protected] 
> <mailto:[email protected]>> wrote:
> 
>     Laurenz Albe <[email protected]
>     <mailto:[email protected]>> 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

-- 
Adrian Klaver
[email protected]







view thread (5+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox