Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tv1qB-0002q2-CL for pgsql-bugs@arkaria.postgresql.org; Tue, 15 Jan 2013 08:25:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tv1qA-0002wk-EO for pgsql-bugs@arkaria.postgresql.org; Tue, 15 Jan 2013 08:25:50 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tv1q9-0002wZ-PD for pgsql-bugs@postgresql.org; Tue, 15 Jan 2013 08:25:49 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tv1q7-0000xt-E4 for pgsql-bugs@postgresql.org; Tue, 15 Jan 2013 08:25:48 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 0831D28A8B; Tue, 15 Jan 2013 00:25:46 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 04BA2184DA; Tue, 15 Jan 2013 00:25:46 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 5F0791219C5; Tue, 15 Jan 2013 00:27:55 -0800 (PST) X-Virus-Scanned: amavisd-new at zcs-prod-ext-mta-1.vmware.com Received: from zcs-prod-ext-mta-1.vmware.com ([127.0.0.1]) by localhost (zcs-prod-ext-mta-1.vmware.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id thTiTy6GoKaV; Tue, 15 Jan 2013 00:27:55 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 251A212199A; Tue, 15 Jan 2013 00:27:55 -0800 (PST) Received: from [192.168.1.90] (unknown [10.113.62.14]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Tue, 15 Jan 2013 00:27:54 -0800 (PST) Message-ID: <50F51294.4090406@vmware.com> Date: Tue, 15 Jan 2013 10:25:56 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11 MIME-Version: 1.0 To: Simon Riggs CC: Tomonari Katsumata , pgsql-bugs@postgresql.org Subject: Re: BUG #7803: Replication Problem(no master is there) References: <50EFCFF5.4040109@vmware.com> <50F00301.1060301@po.ntts.co.jp> <50F4E52E.9000603@po.ntts.co.jp> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 15.01.2013 10:14, Simon Riggs wrote: > On 15 January 2013 05:12, Tomonari Katsumata > wrote: > >>> We added a REPLICATION privelge onto user accounts to control access. >>> >>> Perhaps we should add a CASCADE privilege as well, so that we can >>> control whether we can connect to a master and/or a standby. >>> >>> Syntax would be >>> >>> ALTER USER foo >>> [MASTER | CASCADE] REPLICATION >>> >>> REPLICATION allows both master and cascaded replication (same as now) >>> MASTER REPLICATION allows master only >>> CASCADE REPLICATION allows cascaded replication only >>> NOREPLICATION allows neither option >>> > >> Someone is working for it already ? >> If not yet, may I try to implement it ? > > Please do. It looks fairly short. To me, permissions doesn't feel like the right vehicle for controlling this. Not sure what to suggest instead, a new GUC perhaps. BTW, is there any reason to not allow streaming replication when hot_standby=off? A streaming replication connection doesn't execute any queries, so it doesn't need the system to be consistent. Another thing to consider is that "pg_basebackup -X stream" also uses streaming replication, so if you forbid cascade replication, you also forbid using "pg_basebackup -X stream" on the standby. At the protocol level, pg_basebackup streams the WAL just like a standby server does, so we cannot distinguish those two cases in the server. The client could tell the server which one it is, but using permissions to allow/forbid based on that would make no sense as the client could lie which one it is. - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs