Re: How to create a read only user account to access to all pg database?

From: Shreeyansh Dba <shreeyansh2014(at)gmail(dot)com>
To: KhunSanAung(dot)GIS(at)gmail(dot)com
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: How to create a read only user account to access to all pg database?
Date: 2015-11-25 06:14:55
Message-ID: CAGDYbUN0iv97o0p=hZqeVmqh33YVmrGDhv3XcHs6bpy_VjuqJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi KhunSanAung,

A simple way is Create a user with superuser privileges and read only
permission.

-Login psql as postgres or other superuser.
-Create the new superuser role and set it to read only :

CREATE USER backupadmn WITH PASSWORD 'pwd' SUPERUSER ;
ALTER USER backupadmn set default_transaction_read_only = on;

Regards,
Sagar Jadhav
Database Administrator
www.shreeyansh.com

On Wed, Nov 25, 2015 at 9:05 AM, KhunSanAung <khunsanaung(dot)gis(at)gmail(dot)com>
wrote:

> Hi All,
>
> I have several pg database with their own login user account.
> For backup purpose, I'd like to create an additional read only user
> account that can access all the pg database.
> How can I do it?
> Via PSQL command or via pgAdmin III client would be okay.
>
> Your help is high appreciated.
>
> Many thanks & best regards
>
> --
> Have a nice day!
> --
>
> *Mr. Khun San Aung*
> * <http://geoportal.icimod.org/>*
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Ville Rantamaula 2015-11-25 06:29:24 Re: How to create a read only user account to access to all pg database?
Previous Message Abbas 2015-11-25 05:55:49 Re: function nvl(numeric, integer) does not exist