Re: password in recovery.conf

From: Bosco Rama <postgres(at)boscorama(dot)com>
To: Nelson Green <nelsongreen84(at)gmail(dot)com>, pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: password in recovery.conf
Date: 2014-09-26 20:24:59
Message-ID: 5425CB9B.4050700@boscorama.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 09/26/14 12:58, Nelson Green wrote:
>
> I am setting up a streaming replication stand-by, and the replication
> role password has a single quote in it. I am unable to properly
> reference the password in the conninfo setting of recovery.conf so it
> will authenticate to the master. Doubling the quote gives me a syntax
> error, and escaping it or quoting it with double-quotes gives me an
> authentication error.

You may have to double it twice -- once for recovery.conf and once for
the actual usage in the connection.

Thus for password abc'123 you would want to use:
'user=user_name password=abc''''123 host=primary_host'

Or possibly even a combination of doubling and escaping:
'user=user_name password=abc\''123 host=primary_host'
or:
'user=user_name password=abc\\''123 host=primary_host'

This is just conjecture. I don't use this method of recovery myself.

HTH.

Bosco.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Vanasco 2014-09-26 21:02:25 advice sought - general approaches to optimizing queries around "event streams"
Previous Message Nelson Green 2014-09-26 19:58:04 password in recovery.conf