function to return pg_user.usesysid

Поиск
Список
Период
Сортировка
От Dr. Ernst Molitor
Тема function to return pg_user.usesysid
Дата
Msg-id 1044619436.13636.53.camel@mibi02
обсуждение исходный текст
Ответы Re: function to return pg_user.usesysid
Re: function to return pg_user.usesysid
Список pgsql-hackers
Dear PostgreSQL developers, 

as far as I know, there is no function available to directly access the
user id (pg_(shadow|user).usesysid) 
of the current database user, while the user's name is easily available
(function current_user). 

For a couple of databases I'm using or designing, it is necessary to
keep track of who has changed what and when - a job perfectly easy with
the timetravel add-on (contrib/spi). Using usesysid instead of a user
name to keep track of who has entered/changed/deleted data in a certain
record offers saving a few bytes per record, so I wrote a _very small_
add-on to directly access the usesysid information, using the function
GetUserId(). 

This is hardly worth mentioning since it consists of just a few lines of
code, but maybe some other users might find it useful. If so, please
feel free to make it available publicly. The few lines are available at
http://mibi03.meb.uni-bonn.de/~ernst/pgsql_userid.tar.gz

Hm, by the way, what about adding a function like current_userid to the
core functionality of PostgreSQL?

Best regards, 

Ernst







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

Предыдущее
От: Elias Athanasopoulos
Дата:
Сообщение: cvs (7/2/2003) is broken?
Следующее
От: greg@turnstep.com
Дата:
Сообщение: Re: PGP signing releases