pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Duane Winner <duanewinner@att.net>
To: pgsql-admin@postgresql.org
Cc: Arend P. van der Veen <apvanderveen@att.net>
Cc: David J. Neu <djneu@att.net>
Subject: grant command: wildcard on tables?
Date: Thu, 30 Sep 2004 11:35:56 -0400
Message-ID: <415C27DC.80407@att.net> (raw)

Hello,

We have a database with data loaded and now I need to GRANT 
SELECT,UPDATE,INSERT,DELETE to all tables in 4 different schemas for a 
specific postgresql user account.

I have two problems:

1) One of these schemas has 75 tables. Is there a way to do the GRANT 
command with a wildcard to give the privileges to the user in one fell 
swoop?

I try:

    mydatabase=# grant select,update,insert,delete on schemaA.* to myuser;

and I get:
    ERROR:  relation "schemaA.*" does not exist


2) The other three schemas only have several tables each, so I can just 
run the GRANT command on each schema.table individually, however one 
table has a name with a hyphen it, and this causes an error.

I try:
   
    mydatabase=# grant select,update,insert,delete on schemaB.table-two 
to myuser;
   
and I get:
    ERROR:  syntax error at or near "-" at character 46


Hopefully there are solutions for both of these problems. And I figure 
if I get a solution for problem #1, it will take care of problem #2. Is 
there a wildcard syntax solution for #1? Is there a delimiter syntax 
solution for #2?

Thanks for any info,
Duane Winner




view thread (2+ messages)  latest in thread

Message-ID: <415C27DC.80407@att.net>
Permalink:  ../415C27DC.80407@att.net/
Also on:    postgresql.org/message-id/415C27DC.80407@att.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: duanewinner@att.net, apvanderveen@att.net, djneu@att.net
  Subject: Re: grant command: wildcard on tables?
  In-Reply-To: <415C27DC.80407@att.net>
  References: <415C27DC.80407@att.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