Re: [GENERAL] type "xxxxxxx" does not exist

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [GENERAL] type "xxxxxxx" does not exist
Дата
Msg-id CAKFQuwbfvjfwAzekb2TuBuYepmN9Xo4AbAuFTw5JGCEuvOjcKw@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] type "xxxxxxx" does not exist  (Micky Hulse <mickyhulse@gmail.com>)
Ответы Re: [GENERAL] type "xxxxxxx" does not exist  (Micky Hulse <mickyhulse@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Paul Jungwirth
Дата:
Сообщение: Re: [GENERAL] type "xxxxxxx" does not exist
Следующее
От: Micky Hulse
Дата:
Сообщение: Re: [GENERAL] type "xxxxxxx" does not exist