pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Wasser <erik.wasser@iquer.net>
To: pgsql-sql@postgresql.org
Subject: Full access to a DB with a second user?
Date: Sun, 5 Sep 2004 14:53:57 +0200
Message-ID: <200409051453.57182.erik.wasser@iquer.net> (raw)

Hello pgsql-sql@postgresql.org,

how can I gave a user full access (SELECT, INSERT,...) to a database 
that he doesn't own? I used google to find a solution and I find a 
Statement[1] that will the do the trick. But it looks very cryptical to 
me. B-) What does this statement do?

> \a
> \t
> \o /tmp/grant.sql
> SELECT      'GRANT ALL ON ' || n.nspname || '.' || c.relname ||
>          ' TO joe;'
> FROM      pg_catalog.pg_class AS c
>          LEFT JOIN pg_catalog.pg_namespace AS n
>               ON n.oid = c.relnamespace
> WHERE     c.relkind IN ('r','v','S') AND
>          n.nspname NOT IN ('pg_catalog', 'pg_toast') AND
>          pg_catalog.pg_table_is_visible(c.oid)
> ORDER BY  n.nspname, c.relname;
> \o
> \i /tmp/grant.sql

Any hint is welcome. B-)

[1]http://www.mail-archive.com/pgsql-admin@postgresql.org/msg14416.html

-- 
So long... Fuzz



view thread (2+ messages)  latest in thread

Message-ID: <200409051453.57182.erik.wasser@iquer.net>
Permalink:  ../200409051453.57182.erik.wasser@iquer.net/
Also on:    postgresql.org/message-id/200409051453.57182.erik.wasser@iquer.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: erik.wasser@iquer.net
  Subject: Re: Full access to a DB with a second user?
  In-Reply-To: <200409051453.57182.erik.wasser@iquer.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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