pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedselect a list of schema names
2+ messages / 2 participants
[nested] [flat]
* select a list of schema names
@ 2005-03-25 19:50 Andrus Moor <nospameetasoftnospam@online.ee>
0 siblings, 1 reply; 2+ messages in thread
From: Andrus Moor @ 2005-03-25 19:50 UTC (permalink / raw)
To: pgsql-sql
I want to implement a multi-company database where each schema represents
different company.
I created a number of schemas in a database.
How to select a list of schema names which current user is authorized to
access ?
I want to get the list of companies to allow user pick the one.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: select a list of schema names
@ 2005-03-27 08:04 Michael Fuhr <mike@fuhr.org>
parent: Andrus Moor <nospameetasoftnospam@online.ee>
0 siblings, 0 replies; 2+ messages in thread
From: Michael Fuhr @ 2005-03-27 08:04 UTC (permalink / raw)
To: Andrus Moor <nospameetasoftnospam@online.ee>; +Cc: pgsql-sql
On Fri, Mar 25, 2005 at 09:50:18PM +0200, Andrus Moor wrote:
>
> How to select a list of schema names which current user is authorized to
> access ?
See "System Catalogs" and "System Information Functions" (or
"Miscellaneous Functions") in the documentation. Here are links
to documentation for the latest release:
http://www.postgresql.org/docs/8.0/interactive/catalogs.html
http://www.postgresql.org/docs/8.0/interactive/functions-info.html
Something like this might be what you're looking for:
SELECT nspname
FROM pg_namespace
WHERE has_schema_privilege(nspname, 'USAGE')
ORDER BY nspname;
Note that USAGE privilege on a schema doesn't necessarily mean the
user has any privileges on the objects in that schema.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-03-27 08:04 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-03-25 19:50 select a list of schema names Andrus Moor <nospameetasoftnospam@online.ee>
2005-03-27 08:04 ` Michael Fuhr <mike@fuhr.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox