Re: "Type does not exist" error when returning array of type in non-public schema

From: Chapman Flack <jcflack(at)acm(dot)org>
To: Chris Cleveland <ccleveland(at)dieselpoint(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: "Type does not exist" error when returning array of type in non-public schema
Date: 2025-02-06 21:13:27
Message-ID: 67A525F6.8050706@acm.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 02/06/25 16:06, Chris Cleveland wrote:
> I solved the problem with:
>
> CREATE FUNCTION myfunc ... RETURNS Token[] ... SET search_path to rdb;
>
> I still don't know why it happens in the first place, though.

That pretty much nails down that the type name appears somewhere
in the quoted-literal function body. But you haven't spotted where?

You still haven't mentioned which PL the function is written in.

I wonder if, for some PL, there could be a generated preamble/postamble
around your function body that you don't see, that contains the name
of the return type.

If that were to turn out to be the source of the issue, it would suggest
that the generated code missed a place where the fully-qualified name
should be used.

Regards,
-Chap

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2025-02-06 21:16:48 Re: "Type does not exist" error when returning array of type in non-public schema
Previous Message Chris Cleveland 2025-02-06 21:06:03 Re: "Type does not exist" error when returning array of type in non-public schema