Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h4xid-0006PE-1K for pgsql-general@arkaria.postgresql.org; Sat, 16 Mar 2019 01:02:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h4xia-0003ws-Ck for pgsql-general@arkaria.postgresql.org; Sat, 16 Mar 2019 01:02:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h4xiZ-0003td-Pz for pgsql-general@lists.postgresql.org; Sat, 16 Mar 2019 01:02:32 +0000 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h4xiS-0005jk-MF for pgsql-general@lists.postgresql.org; Sat, 16 Mar 2019 01:02:30 +0000 Received: by mail-ot1-x341.google.com with SMTP id i5so9942189oto.9 for ; Fri, 15 Mar 2019 18:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=If3u/tXKKji2GYgyudxxuIELuKI+18l73UaGgGMmVF4=; b=UXtNWjPJkhCsq0jG9sI/2/5fR/UQbQPnYQCLyYeQKswYpEA0l/r7xTSDaP9BRjLyUq v00WtBnivjtkQMr2c/SEse1msPdKWCVKCpfbEzW7WQMphpgrTFto1HCjx6ToIWf2RjEi Ee0QRJLmG8GDEiIbDuTYUWpb8+43GsRqxO8ZQJ1iyHUk0pLmVsyHUqGHQndRVPoiincX s2ksqWkEDqYPpCh5D9vrioXT5rcS6w6YVj/F2mrdpj1b+cuhuWdJqhZiCvPDSdWv5/cQ JG4o7AyOCb1GqFLr9d3ALTWkptZvyPFP/mlHOge2F5jS6FKjLoQbrKCdFK2X7aYCRYcq upNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=If3u/tXKKji2GYgyudxxuIELuKI+18l73UaGgGMmVF4=; b=OF+6nX9MHkuGLqefk9OKuCvek9gFjY8UZYgX2fzg9eJKtI6mZ3UvngfBA3dl5QFOPc sjT3J3xHpyRPeIYTip1Mhaiv3+TqKiquGs240kI5zmTaGpbZ0KncgqW8XVKidTX2k+6c mMBK1W48UKLLksGpCsSHHx6sdbd+NT0g+u8vr9bYb/2H19GijWyH45kPUn0xetNskOrT zDRUIiegh+a83BBGRG8EI86NobAtgSScGFyo8sjV8HEGkPppiFvWF5O1BDpjpWoBL5v7 owbQW+w7dFWfre+MCnHQ33shPRQ3BbDyEYNOy+GV3uijRDpcctmxzN0mfX1CMi68uFZN vY+w== X-Gm-Message-State: APjAAAX6FudgSFCbjte6us3vVTekRx3LirafWpvi6gVhNIIaZnQp9XPv PI94ZJCnEcZqpsYixqA/Kk+1Iou/ X-Google-Smtp-Source: APXvYqyf4lrn4BiYSuggfLjIV2xzJxEjo2qhy7GoTXWonYigGLhnlvccCesWa+aMH62iVUnuCoVEDA== X-Received: by 2002:a9d:4b17:: with SMTP id q23mr4035218otf.35.1552698143386; Fri, 15 Mar 2019 18:02:23 -0700 (PDT) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id p187sm1411728oif.17.2019.03.15.18.02.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 18:02:22 -0700 (PDT) Subject: Re: Permission Read Only User To: pgsql-general@lists.postgresql.org References: From: Ron Message-ID: <24342e74-6ab2-97c9-2ac5-e34349ff0b21@gmail.com> Date: Fri, 15 Mar 2019 20:02:21 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/15/19 6:44 PM, Adrian Klaver wrote: > On 3/15/19 4:37 PM, Sathish Kumar wrote: >> Hi All, >> >> I have created a read only user to perform select statements on our >> database but whenever we create new tables on the database this user is >> unable to view it unless I grant select again for this table. Is there a >> way I can make select as default permission for this user so that in >> future if I create any new tables, it will be still accessible. > > Maybe this?: > > https://www.postgresql.org/docs/11/sql-alterdefaultprivileges.html That's just what we used. Create a role READONLY who is granted CONNECT and alter the default permissions on all your schemas to grant SELECT to that role. Then create "user" roles which inherit from READONLY. -- Angular momentum makes the world go 'round.