grant command: wildcard on tables?

From: Duane Winner <duanewinner(at)att(dot)net>
To: pgsql-admin(at)postgresql(dot)org
Cc: "Arend P(dot) van der Veen" <apvanderveen(at)att(dot)net>, "David J(dot) Neu" <djneu(at)att(dot)net>
Subject: grant command: wildcard on tables?
Date: 2004-09-30 15:35:56
Message-ID: 415C27DC.80407@att.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message JEDIDIAH 2004-09-30 15:36:23 Re: [GENERAL] High Availability - Performace Scalability -
Previous Message stig erikson 2004-09-30 15:32:59 Re: fedora core 2 postgresql regression tests fail