Skip site navigation (1) Skip section navigation (2)

Re: [COMMITTERS] pgsql: Add connection messages for streaming replication.

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Add connection messages for streaming replication.
Date: 2010-03-24 11:09:00
Message-ID: 1269428940.8481.7805.camel@ebony (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
On Wed, 2010-03-24 at 19:49 +0900, Fujii Masao wrote:
> On Wed, Mar 24, 2010 at 7:29 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> > So we are allowing a database to be called "REPLICATION"?
> 
> Yes.
> 
> > Surely there
> > are some significant problems in that case. How will access control to
> > that database work in the pg_hba.conf?
> 
> We can do that by enclosing the database field of pg_hba.conf in double
> quotes as follows.
> 
>     TYPE   DATABASE        USER  CIDR-ADDRESS  METHOD
>     host   "replication"   foo   192.168.0.5   md5
> 
> In pg_hba.conf, double-quoted keyword like "all", "sameuser", "samerole"
> or "replication" matches a database with that name.

So we might have a pg_hba.conf that looks like this

TYPE   DATABASE        USER  CIDR-ADDRESS  METHOD
host   "replication"   foo   192.168.0.5   md5
host   replication     foo   192.168.0.5   md5

Which looks pretty strange.
I think we should change that, though if not we should at least document
it.

That probably tips the balance towards having the alternate wording:
LOG:  replication connection authorized: user=foo



It also highlights another problem: it's possible to have database names
that contain spaces. There are no double quotes around most of the
things that get logged. So if we do

CREATE DATABASE "oh my god";

will cause things like this to be logged without quotes

LOG:  connection authorized: user=foo database=oh my god

-- 
 Simon Riggs           www.2ndQuadrant.com


In response to

Responses

pgsql-hackers by date

Next:From: Gokulakannan SomasundaramDate: 2010-03-24 11:17:20
Subject: Performance Improvement for Unique Indexes
Previous:From: Fujii MasaoDate: 2010-03-24 10:49:48
Subject: Re: [COMMITTERS] pgsql: Add connection messages for streaming replication.

pgsql-committers by date

Next:From: Heikki LinnakangasDate: 2010-03-24 11:22:47
Subject: Re: Re: [COMMITTERS] pgsql: Add connection messages for streaming replication.
Previous:From: Fujii MasaoDate: 2010-03-24 10:49:48
Subject: Re: [COMMITTERS] pgsql: Add connection messages for streaming replication.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group