Include RELKIND_TOASTVALUE in get_relkind_objtype

Поиск
Список
Период
Сортировка
От Hsu, John
Тема Include RELKIND_TOASTVALUE in get_relkind_objtype
Дата
Msg-id C652D3DF-2B0C-4128-9420-FB5379F6B1E4@amazon.com
обсуждение исходный текст
Ответы Re: Include RELKIND_TOASTVALUE in get_relkind_objtype  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Hello,

get_relkind_objtype(...) was introduced as part of 8b9e9644dc, and it doesn't include
RELKIND_TOASTVALUE. As a result when a user who has usage rights on schema pg_toast
and attempts to reindex a table it is not the owner of it fails with the wrong error
message.

testuser is a non-superuser role who has been granted all on pg_toast

postgres=> \c
You are now connected to database "postgres" as user "testuser".
postgres=> REINDEX TABLE pg_toast.pg_toast_16388;
ERROR:  unexpected relkind: 116

It seems get_relkind_objtype(...) is only used as part of aclcheck_error(...)
I've attached a patch to include RELKIND_TOASTVALUE in get_relkind_objtype. 
Now it fails with the proper error message.

postgres=> \c
You are now connected to database "postgres" as user "testuser".
postgres=> REINDEX TABLE pg_toast.pg_toast_16388;
ERROR:  must be owner of table pg_toast_16388

Cheers,

John H


Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Don't codegen deform code for virtual tuples in expr eval forscan fetch
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: SSL tests failing for channel_binding with OpenSSL <= 1.0.1