Re: Refer to all tables in a database (Postgres)

From: Date: Fri, 22 Dec 2000 23:36:21 +0000
Subject: Re: Refer to all tables in a database (Postgres)
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-5425@lists.php.net to get a copy of this message
Brad Hubbard wrote: > > > How can I reference all tables in a Postgres database i.e.; > > > > "GRANT SELECT ON dbase.* TO fred" > > > > The above syntax works in MySQL (I believe), but not in PostgreSQL. > > > > I can't believe there's no one on this list who can answer this? > > Cheers, > Brad Maybe it's because more people are using MySQL than PostgresSQL. I really don't how to do it in one command. Most database have a table that lists all the name of the tables, you might want to look for that. after, you could do something like GRANT SELECT ON (SELECT name FROM table_table) TO fred or something like that. I never did use Postgres and I don't know if it would work. Another way (still using the table that lists tables) would be to do an iterative (eg for, while) and execute it once for each table.

« previous php.db (#5425) next »