Proposal to suppress errors thrown by to_reg*()

Поиск
Список
Период
Сортировка
От Takuma Hoshiai
Тема Proposal to suppress errors thrown by to_reg*()
Дата
Msg-id 20190314133700.c271429ddc00ddab3aac2619@sraoss.co.jp
обсуждение исходный текст
Ответы Re: Proposal to suppress errors thrown by to_reg*()
Re: Proposal to suppress errors thrown by to_reg*()
Список pgsql-hackers
Hi, hackers,

According to the document, "to_reg* functions return null rather than
throwing an error if the name is not found", but this is not the case
if the arguments to those functions are schema qualified and the
caller does not have access permission of the schema even if the table
(or other object) does exist -- we get an error.

For example, to_regclass() throws an error if its argument is
'schema_name.table_name'' (i.e. contains schema name) and caller's
role doesn't have access permission of the schema. Same thing can be
said to Other functions,

I get complain from Pgpool-II users because it uses to_regclass()
internally to confirm table's existence but in the case above it's
not useful because the error aborts user's transaction.

To be more consistent with the doc and to make those functions more
useful, I propose to change current implementation so that they do not
throw an error if the name space cannot be accessible by the caller.

Attached patch implements this. Comments and suggestions are welcome.

-- 
Takuma Hoshiai <hoshiai@sraoss.co.jp>

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Tid scan improvements
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Offline enabling/disabling of data checksums