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

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array
Дата
Msg-id 12ce45df-2617-4106-9cbb-17c4d58b1bf7@aklaver.com
обсуждение исходный текст
Ответ на Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array  (Rumpi Gravenstein <rgravens@gmail.com>)
Список pgsql-general

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 <tgl@sss.pgh.pa.us 
> <mailto:tgl@sss.pgh.pa.us>> wrote:
> 
>     Laurenz Albe <laurenz.albe@cybertec.at
>     <mailto:laurenz.albe@cybertec.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

-- 
Adrian Klaver
adrian.klaver@aklaver.com




В списке pgsql-general по дате отправления: