Re: Which error constant to use for "permission deny error when updating a table that user is not allowd to "

Поиск
Список
Период
Сортировка
От William Leite Araújo
Тема Re: Which error constant to use for "permission deny error when updating a table that user is not allowd to "
Дата
Msg-id bc63ad820604031244i5b4957bey892fe56888baff8@mail.gmail.com
обсуждение исходный текст
Ответ на Which error constant to use for "permission deny error when updating a table that user is not allowd to "  (Emi Lu <emilu@encs.concordia.ca>)
Список pgsql-general
     Why doesn't test before update?
     IF EXISTS( SELECT * FROM information_schema.table_privileges WHERE grantee = '1' AND table_name = '2' AND privilege_type = 'UPDATE') THEN
         ...
     ELSE
         ...
     END IF;

On 4/3/06, Emi Lu <emilu@encs.concordia.ca> wrote:
Hello,

I am trying to catch permission denied exception. For example, user 1 is
not allowed to update table 2, when user1 updated table 2 there is a
permission excetpion.

In http://www.postgresql.org/docs/8.1/static/errcodes-appendix.html,
I tried "modifying_sql_data_not_permitted" , "sql_routine_exception",
"external_routine_exception" but none of them catch the permission deny
error.

Could someone tell me which error constant should I use to catch the
permission denied error please?

Thanks a lot!
Ying


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match



--
William Leite Araújo

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

Предыдущее
От: Emi Lu
Дата:
Сообщение: Which error constant to use for "permission deny error when updating a table that user is not allowd to "
Следующее
От: MaRCeLO PeReiRA
Дата:
Сообщение: Log Slow Queries