Re: [HACKERS] Get OID of just inserted record

Поиск
Список
Период
Сортировка
От D'Arcy" "J.M." Cain
Тема Re: [HACKERS] Get OID of just inserted record
Дата
Msg-id m11izSX-0000bFC@druid.net
обсуждение исходный текст
Ответ на RE: [HACKERS] Get OID of just inserted record  ("Ansley, Michael" <Michael.Ansley@intec.co.za>)
Список pgsql-hackers
Thus spake Ansley, Michael
>Well, with autocommit on, the statement would fail, and I would expect the
>insert to then roll back, if the select part failed.  No problem, really.

Well, autocommit would only matter if it was decided that it wasn't an
atomic transaction.  If, as seems both sensible and consensed (look, I
made up another word :-) the transaction should be atomic, then the
state of autocommit shouldn't matter.

However, it almost begs the question of whether there should be another
permission that could be granted.  We may want to allow someone to see
the value of just inserted data after adjustments but not on the table
in general.  This statement would give us that as well if we added a
new perm.

GRANT INSERT, SELECT_ON_INSERT ...

or

GRANT INSERT, RSELECT... -- for Restricted SELECT.  ISELECT perhaps?

So someone can get the serial number of an entry that they just inserted
but they wouldn't be able to look at the table in general.  That's a
feature that I could have used in a database I have.  Instead I had to
give SELECT perms to a user on a table that I would have preferred to
otherwise keep hidden.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


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

Предыдущее
От: "D'Arcy" "J.M." Cain
Дата:
Сообщение: Re: [HACKERS] Get OID of just inserted record
Следующее
От: Akmal Hasan
Дата:
Сообщение: unsubcribe