Expression index with function based on current_user?

Поиск
Список
Период
Сортировка
От Fredrik Olsson
Тема Expression index with function based on current_user?
Дата
Msg-id 43E9D560.5000404@treyst.se
обсуждение исходный текст
Ответы Re: Expression index with function based on current_user?  ("Pavel Stehule" <pavel.stehule@hotmail.com>)
Re: Expression index with function based on current_user?  (Hannu Krosing <hannu@skype.net>)
Re: Expression index with function based on current_user?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I have private tables such as this (Very simplified):
CREATE TABLE private.t_foo ( ...
);
REVOKE ALL ON private.t_foo FROM public;

Different users have access to different  data in the table, so I do 
this view:
CREATE VIEW foo AS SELECT * FROM private.t_foo WHERE private.haveaccess();
GRANT ALL ON foo TO public;

Using rules I then make the view updatable (In reality views fetch and 
write data to multiple tables usually). This works fine, but I have some 
thought on performance in the future.

The function private.haveaccess()'s result depends on the currently 
logged in user, is it still possible to create an expression index over 
that function?

// Fredrik Olsson



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

Предыдущее
От: Csaba Nagy
Дата:
Сообщение: Re: streamlined standby procedure
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: Expression index with function based on current_user?