Re: [GENERAL] type "xxxxxxx" does not exist - Mailing list pgsql-general

From David G. Johnston
Subject Re: [GENERAL] type "xxxxxxx" does not exist
Date
Msg-id CAKFQuwbfvjfwAzekb2TuBuYepmN9Xo4AbAuFTw5JGCEuvOjcKw@mail.gmail.com
Whole thread Raw
In response to [GENERAL] type "xxxxxxx" does not exist  (Micky Hulse <mickyhulse@gmail.com>)
Responses Re: [GENERAL] type "xxxxxxx" does not exist
List pgsql-general
On Fri, May 19, 2017 at 1:06 PM, Micky Hulse <mickyhulse@gmail.com> wrote:

​Short answer here is that whomever is calling that function needs to ensure that their search_path is setup so that the type can be found somewhere in it.  Your desire for obscurity means you are pretty much on the hook for figuring out the right command to do so.

See https://www.postgresql.org/docs/current/static/config-setting.html for help on various ways to go about making the actual change.


I hope this is the right list for me to ask questions about psql.
Please let me know if I am in the wrong place. :)

​Right place

When listing the functions, I see that functionName() does exist in
the database.

​As the error is coming from within the function it indeed must exist and be visible to you.

The type also exists (I think):

# select exists (select 1 from pg_type where typname = 'xxx_xxx_xxxxx');
 exists
--------
 t
(1 row)

​Existence and visability​ are two different things.  It indeed exists.  It is apparently not visible to the user when at the time the function is invoked - and the function doesn't explicitly say where to find it.
 

Note that the role that owns the 'type' is not the same user that is
calling the "functionName()" from the psql prompt.

Doesn't matter.  Types in PostgreSQL are not restricted since they never themselves contain any data.  As long as you can find a custom type you can use it.

 
ALTER TYPE xxx_xxx_xxxxx OWNER TO otherusername;


​All objects have owners.​

​David J.

pgsql-general by date:

Previous
From: Paul Jungwirth
Date:
Subject: Re: [GENERAL] type "xxxxxxx" does not exist
Next
From: Micky Hulse
Date:
Subject: Re: [GENERAL] type "xxxxxxx" does not exist