From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
---|---|
To: | Martin Pihlak <martin(dot)pihlak(at)gmail(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: SQL/MED compatible connection manager |
Date: | 2009-03-04 13:26:36 |
Message-ID: | 49AE818C.6080408@gmx.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Martin Pihlak wrote:
> Proposal attached. This adds two C functions:
>
> List *GetForeignConnectionOptions(Oid serverid, Oid userid);
> char *GetForeignConnectionString(Oid serverid, Oid userid);
>
> One for obtaining all of the connection related options as a list, and
> another for transforming these options into a libpq conninfo string.
> The latter should be useful for dblink (although the userid and serverid
> need to be obtained first).
>
> On top of those there are two SQL accessible functions:
>
> pg_foreign_connection_options(server name, user name = current_user,
> OUT option_class text, OUT option_name text, OUT option_value text);
>
> pg_foreign_connection_string(server name, user name = current_user);
>
> These should initially be restricted from ordinary users -- grant explicitly
> if the user should see the connect strings.
Back to this one ...
I have been thinking about this for a great while now. I am not yet
comfortable with how we manage the access rights here. We have
restricted access to the user mappings catalog to hide passwords, but it
is not entirely clear why a password must be stored in a user mapping.
It could also be stored with a server, if we only want to use one global
connection for everybody.
I think the proper way to handle it might be to introduce a new
privilege type -- call it SELECT if you like -- that determines
specifically whether you can *see* the options of a foreign-data
wrapper, foreign server, or user mapping, respectively. As opposed to
USAGE, which means you can use the object for connecting (in the
future). This might have other uses: The owner of a server might want
to hide the host name, but still let you connect.
Comments?
From | Date | Subject | |
---|---|---|---|
Next Message | Heikki Linnakangas | 2009-03-04 13:58:21 | Re: SIGHUP during recovery |
Previous Message | Greg Stark | 2009-03-04 12:41:41 | Re: Regclass and quoted table names |