public inbox for [email protected]
help / color / mirror / Atom feedRe: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array
5+ messages / 5 participants
[nested] [flat]
* Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array
@ 2025-07-25 20:44 Laurenz Albe <[email protected]>
2025-07-25 20:52 ` Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array Tom Lane <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Laurenz Albe @ 2025-07-25 20:44 UTC (permalink / raw)
To: Tom Lane <[email protected]>; Rumpi Gravenstein <[email protected]>; +Cc: PostgreSQL <[email protected]>
On Fri, 2025-07-25 at 14:10 -0400, Tom Lane wrote:
> 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?
... it could also be a type "sa_setup_role", and "_sa_setup_role"
is interpreted as the corresponding array type:
CREATE DOMAIN sa_setup_role AS varchar;
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.
Yours,
Laurenz Albe
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array
2025-07-25 20:44 Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array Laurenz Albe <[email protected]>
@ 2025-07-25 20:52 ` Tom Lane <[email protected]>
2025-08-06 20:17 ` Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array Rumpi Gravenstein <[email protected]>
0 siblings, 1 reply; 5+ messages in thread
From: Tom Lane @ 2025-07-25 20:52 UTC (permalink / raw)
To: Laurenz Albe <[email protected]>; +Cc: Rumpi Gravenstein <[email protected]>; PostgreSQL <[email protected]>
Laurenz Albe <[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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array
2025-07-25 20:44 Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array Laurenz Albe <[email protected]>
2025-07-25 20:52 ` Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array Tom Lane <[email protected]>
@ 2025-08-06 20:17 ` Rumpi Gravenstein <[email protected]>
2025-08-06 20:25 ` Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array Ron Johnson <[email protected]>
2025-08-06 20:43 ` Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array Adrian Klaver <[email protected]>
0 siblings, 2 replies; 5+ messages in thread
From: Rumpi Gravenstein @ 2025-08-06 20:17 UTC (permalink / raw)
To: Tom Lane <[email protected]>; +Cc: Laurenz Albe <[email protected]>; PostgreSQL <[email protected]>
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 <[email protected]> wrote:
> Laurenz Albe <[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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array
2025-07-25 20:44 Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array Laurenz Albe <[email protected]>
2025-07-25 20:52 ` Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array Tom Lane <[email protected]>
2025-08-06 20:17 ` Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array Rumpi Gravenstein <[email protected]>
@ 2025-08-06 20:25 ` Ron Johnson <[email protected]>
1 sibling, 0 replies; 5+ messages in thread
From: Ron Johnson @ 2025-08-06 20:25 UTC (permalink / raw)
To: PostgreSQL <[email protected]>
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 <[email protected]> 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 <[email protected]> wrote:
>
>> Laurenz Albe <[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
>
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array
2025-07-25 20:44 Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array Laurenz Albe <[email protected]>
2025-07-25 20:52 ` Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array Tom Lane <[email protected]>
2025-08-06 20:17 ` Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array Rumpi Gravenstein <[email protected]>
@ 2025-08-06 20:43 ` Adrian Klaver <[email protected]>
1 sibling, 0 replies; 5+ messages in thread
From: Adrian Klaver @ 2025-08-06 20:43 UTC (permalink / raw)
To: Rumpi Gravenstein <[email protected]>; Tom Lane <[email protected]>; +Cc: Laurenz Albe <[email protected]>; PostgreSQL <[email protected]>
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]
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2025-08-06 20:43 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-07-25 20:44 Re: PostgreSQL Bug with simple function unexpectedly treating varchar parameter as an array Laurenz Albe <[email protected]>
2025-07-25 20:52 ` Tom Lane <[email protected]>
2025-08-06 20:17 ` Rumpi Gravenstein <[email protected]>
2025-08-06 20:25 ` Ron Johnson <[email protected]>
2025-08-06 20:43 ` Adrian Klaver <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox