Re: [GENERAL] What user to defaults execute as?

Поиск
Список
Период
Сортировка
Искать
От
Peter Eisentraut
Тема
Re: [GENERAL] What user to defaults execute as?
Дата
Msg-id
Pine.LNX.4.44.0211052007430.1815-100000@localhost.localdomain
Ответ на
Список
Дерево обсуждения
Re: setuid for defaults, constraints and triggers (Was: Rod Taylor <rbt@rbt.ca>
Re: setuid for defaults, constraints and triggers (Was: What user to [sic] defaults execute as?) Bruno Wolff III <bruno@wolff.to>
Re: setuid for defaults, constraints and triggers (Was: Rod Taylor <rbt@rbt.ca>
Re: setuid for defaults, constraints and triggers (Was: What user to [sic] defaults execute as?) Bruno Wolff III <bruno@wolff.to>
Tom Lane writes:

> Okay, I've thought of one: consider the situation where you want to
> label each row in a table with the ID of the user who inserted it.
> Right now, you can do
> 	...,
> 	who	name	default current_user,
> 	...
> or for greater security use a trigger to set the column value.
> This will stop working if defaults and triggers run as the table
> owner.

According to the SQL standard, privileges on constraints should
effectively be checked at the time the constraint is created.  For
example, when you create a foreign key constraint you may need certain
REFERENCES privileges, and equally creating check constraints should
require REFERENCES privilege on tables involved in subqueries.

While the SQL standard doesn't say anything on how this should apply to
column defaults (since there you can't call user-defined functions or
subqueries in default clauses), it would make sense to carry this over.

-- 
Peter Eisentraut   peter_e@gmx.net


В списке pgsql-hackers по дате отправления
От: Bruce Momjian
Дата:
Сообщение: Re: PL/Perl and Perl 5.8
От: Marc G. Fournier
Дата:
FAQ