Re: function to return pg_user.usesysid

From: Kevin Brown <kevin(at)sysexperts(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: function to return pg_user.usesysid
Date: 2003-02-08 11:09:34
Message-ID: 20030208110934.GB1833@filer
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sysexperts(dot)com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Samuel Sieb 2003-02-08 19:34:05 UNIQUE not unique with inheritance (workaround?)
Previous Message Neil Conway 2003-02-07 23:50:25 Re: function to return pg_user.usesysid