Re: function to return pg_user.usesysid - Mailing list pgsql-hackers

From Kevin Brown
Subject Re: function to return pg_user.usesysid
Date
Msg-id 20030208110934.GB1833@filer
Whole thread Raw
In response to Re: function to return pg_user.usesysid  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
Neil Conway wrote:
> On Fri, 2003-02-07 at 07:03, Dr. Ernst Molitor wrote:
> > Hm, by the way, what about adding a function like current_userid to the
> > core functionality of PostgreSQL?
> 
> What exactly would this do that couldn't be done by just querying
> pg_user directly?
> 
> SELECT usesysid FROM pg_user WHERE usename = CURRENT_USER;

The function would be maintained and would work no matter what changes
to the underlying tables were made.

Not that such changes are terribly likely for this case, mind you.

Are there any situations in which it would be useful to deny access to
certain system tables, like pg_user?  Would doing so automatically
prevent any users who were under such restrictions from doing anything
useful?  If such a thing is possible and potentially useful, then it's
another reason for the function Dr. Molitor mentioned.


-- 
Kevin Brown                          kevin@sysexperts.com


pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: function to return pg_user.usesysid
Next
From: Samuel Sieb
Date:
Subject: UNIQUE not unique with inheritance (workaround?)