Re: [HACKERS] Re: New pg_pwd patch and stuff

From: Peter T Mount <psqlhack(at)maidast(dot)demon(dot)co(dot)uk>
To: todd brandys <brandys(at)eng3(dot)hep(dot)uiuc(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Re: New pg_pwd patch and stuff
Date: 1998-01-14 06:52:45
Message-ID: Pine.LNX.3.95.980114064822.10131A-100000@maidast
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 13 Jan 1998, todd brandys wrote:

> On Sun, 11 Jan 1998, Bruce Momjian wrote:
>
> > OK, general question. Does pg_user need to be readable? Do
> > non-postgres users want to see who owns each table? I don't know.
>
> I'd say yes, as we have stuff in JDBC yet to implement that will access
> this table.
>
> ----------------------------------
>
> What is it that you need to implement in JDBC for which a general user needs
> to be able to see tables that other users own? If this is some type of admin,
> 'stuff' that the postgres user will execute, then he/she will be able to run it
> no problem.

It's a call that's part of the JDBC specification. so it can be called by
user code, or admin code.

Here's what I have on it.

Interface java.sql.DatabaseMetaData

public abstract ResultSet getTablePrivileges(String catalog,
String schemaPattern,
String tableNamePattern)
throws SQLException


Get a description of the access rights for each table available
in a catalog. Note that a table privilege applies to one or
more columns in the table. It would be wrong to assume that
this priviledge applies to all columns (this may be true for
some systems but is not true for all.)

Only privileges matching the schema and table name criteria are
returned. They are ordered by TABLE_SCHEM, TABLE_NAME, and
PRIVILEGE.

Each privilige description has the following columns:

1. TABLE_CAT String => table catalog (may be null)
2. TABLE_SCHEM String => table schema (may be null)
3. TABLE_NAME String => table name
4. GRANTOR => grantor of access (may be null)
5. GRANTEE String => grantee of access
6. PRIVILEGE String => name of access (SELECT, INSERT, UPDATE,
REFRENCES, ...)
7. IS_GRANTABLE String => "YES" if grantee is permitted to grant
to others; "NO" if not; null if unknown


Parameters:
catalog - a catalog name; "" retrieves those without a
catalog; null means drop catalog name from the selection
criteria
schemaPattern - a schema name pattern; "" retrieves those
without a schema
tableNamePattern - a table name pattern

Returns:
ResultSet - each row is a table privilege description

Throws: SQLException
if a database-access error occurs.

See Also:
getSearchStringEscape

--
Peter T Mount petermount(at)earthling(dot)net or pmount(at)maidast(dot)demon(dot)co(dot)uk
Main Homepage: http://www.demon.co.uk/finder
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter(at)maidstone(dot)gov(dot)uk

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter T Mount 1998-01-14 06:58:37 Re: [HACKERS] grant still broken
Previous Message todd brandys 1998-01-14 05:40:57 Suggest a pg_privileges table