Thread: GRANT all to a super user
What is the (is there a) grant command that I can use to create a super user without having to specify all the DB objects?
grant all on database foo to thesuper;
and
grant all privileges on database foo to thesuper;
Don’t work.
I know I can achieve what I want by submitting a grant for each and every object in the DB. But is there a way to do it all with one command, maybe something like...
“grant all privileges on everything to thesuper” ?
Thanks
-dave
Hello there are not similar statement if you would to grant rights to more database objects, you have to use script or stored procedure. regards Pavel Stehule 2009/5/27 Gauthier, Dave <dave.gauthier@intel.com>: > What is the (is there a) grant command that I can use to create a super user > without having to specify all the DB objects? > > > > grant all on database foo to thesuper; > > and > > grant all privileges on database foo to thesuper; > > > > Don’t work. > > > > I know I can achieve what I want by submitting a grant for each and every > object in the DB. But is there a way to do it all with one command, maybe > something like... > > > > “grant all privileges on everything to thesuper” ? > > > > Thanks > > -dave
What is the (is there a) grant command that I can use to create a super user without having to specify all the DB objects?
grant all on database foo to thesuper;
and
grant all privileges on database foo to thesuper;
Don’t work.
I know I can achieve what I want by submitting a grant for each and every object in the DB. But is there a way to do it all with one command, maybe something like...
“grant all privileges on everything to thesuper” ?
Thanks
-dave
There is a '-s' option for createuser that designates the user account as a superuser.
You can use 'alter user' or 'alter role' to give superuser authority to an existing account:
alter user [account name] with superuser;
I think the superuser role applies to all databases.
Andrew
On 2009-05-27, Gauthier, Dave <dave.gauthier@intel.com> wrote: > --_000_482E80323A35A54498B8B70FF2B87980040AEFF544azsmsx504amrc_ > Content-Type: text/plain; charset="us-ascii" > Content-Transfer-Encoding: quoted-printable > > What is the (is there a) grant command that I can use to create a super use= > r without having to specify all the DB objects? SUPERUSER cant be GRANTed, it's done with ALTER USER instead.. ALTER USER fred WITH SUPERUSER. as a superuser fred can now do anything that other superusers (eg, "postgres") can do. ( ie: create users, etc..) if you don't want that you may instead want to grant fred the role of the database ownwer, assuming the database owner is "dave" GRANT dave TO fred; use WITH ADMIN OPTION at the end if you want to let fred invite bill to the party too.