Search Postgresql Archives

Re: type "xxxxxxx" does not exist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 19, 2017 at 1:06 PM, Micky Hulse <mickyhulse@xxxxxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux