Thread: GRANT on database

GRANT on database

From
Boulat Khakimov
Date:
Hi,

How do I grant all on database TO PUBLIC?
Without having to go through each table in that database?

Basically I have created a databases as one user, and I want another
user
to be able to access all tables in that database. However
when i run simple query like "SELECT * from tablename"  as that "other
user"
it gives me (ERROR:  tablename: Permission denied).

GRANT doesnt let you grant access to the entire databases , only tables.
and since I have over 30 tables in my DB goin through each table and
setting
permissions by hand is too time consuming.



Regards,
Boulat.



--
Nothing Like the Sun

Re: GRANT on database

From
will trillich
Date:
On Mon, Mar 05, 2001 at 01:30:01PM -0500, Boulat Khakimov wrote:
> Hi,
>
> How do I grant all on database TO PUBLIC?
> Without having to go through each table in that database?
>
> Basically I have created a databases as one user, and I want another
> user
> to be able to access all tables in that database. However
> when i run simple query like "SELECT * from tablename"  as that "other
> user"
> it gives me (ERROR:  tablename: Permission denied).
>
> GRANT doesnt let you grant access to the entire databases , only tables.
> and since I have over 30 tables in my DB goin through each table and
> setting
> permissions by hand is too time consuming.

<guessing>

i'd
    \o mytables.sql
    select tablename from pg_tables where tableowner='whoever';
then edit the file to create grant statements, and then
    \i mytables.sql
and be done with it...

(sure would be nice if we could
    grant select to public on
    (select tablename from pg_tables where tableowner='whoever');
but i don't think that'll work.)
</guessing>

--
It is always hazardous to ask "Why?" in science, but it is often
interesting to do so just the same.
        -- Isaac Asimov, 'The Genetic Code'

will@serensoft.com
http://groups.yahoo.com/group/newbieDoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

Unknown Response Type???

From
"chris markiewicz"
Date:
Unknown Response Type 
    at org.postgresql.Connection.ExecSQL(Connection.java:420)
    at org.postgresql.jdbc2.Statement.execute(Statement.java:273)
    at org.postgresql.jdbc2.Statement.executeQuery(Statement.java:54)

does anyone know what the above error means?

thanks
chris


multiple dbs on a port

From
"chris markiewicz"
Date:
hello

i currently have two databases (development and qa) running on the same
port.  i recently had a situation where both databases gave me a "too many
clients" at the same time.  is this just a coincidence or do all databases
on a common port share other parameters or resources?

thanks
chris


Re: multiple dbs on a port

From
Peter Eisentraut
Date:
chris markiewicz writes:

> i currently have two databases (development and qa) running on the same
> port.  i recently had a situation where both databases gave me a "too many
> clients" at the same time.  is this just a coincidence or do all databases
> on a common port share other parameters or resources?

The connection limit is per server (i.e., postmaster process).  It doesn't
matter how many databases the server has access to.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


Re: Unknown Response Type???

From
"Brent R. Matzelle"
Date:
--- chris markiewicz <cmarkiew@commnav.com> wrote:
> Unknown Response Type 
>     at org.postgresql.Connection.ExecSQL(Connection.java:420)
>     at org.postgresql.jdbc2.Statement.execute(Statement.java:273)
>     at
> org.postgresql.jdbc2.Statement.executeQuery(Statement.java:54)
>
> does anyone know what the above error means?

Please provide your JDBC connection code.  It is impossible to
troubleshoot without the program's context.

Brent


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/