Re: disallow updates on column or whole table

Поиск
Список
Период
Сортировка
От Bill Moran
Тема Re: disallow updates on column or whole table
Дата
Msg-id 20081210091404.5c8acebb.wmoran@collaborativefusion.com
обсуждение исходный текст
Ответ на disallow updates on column or whole table  (Peter Billen <peter@clueless.be>)
Список pgsql-general
Don't change thread subjects, it confuses people.  Start a new thread
if you have a new topic.

In response to Peter Billen <peter@clueless.be>:
>
> What is the best way to disallow updates on a column of a table, or even
> on a whole table itself?
>
> I can write a BEFORE UPDATE trigger which compares old.column_name(s) to
> new.column_name(s) and raise an exception if these values are different.
>
> Are there better ways?

You can use the GRANT system to enforce table-wide restrictions.  See
the docs on GRANT and REVOKE and associated doc sections.

--
Bill Moran
Collaborative Fusion Inc.
http://people.collaborativefusion.com/~wmoran/

wmoran@collaborativefusion.com
Phone: 412-422-3463x4023

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

Предыдущее
От: "Grzegorz Jaśkiewicz"
Дата:
Сообщение: Re: 8.2.6 -> 8.1.11: syntax error at or near "OWNED BY"
Следующее
От: Mark Morgan Lloyd
Дата:
Сообщение: Re: Favorite Tom Lane quotes