pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 范国腾 <fanguoteng@highgo.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
To: users@clusterlabs.org <users@clusterlabs.org>
Cc: 祁华鹏 <qihuapeng@highgo.com>
Subject: How to make PAF use psql to login with password
Date: Wed, 6 Mar 2019 01:57:58 +0000
Message-ID: <79886fabd93e4b83b19c55f97b4210ef@EX02.highgo.com> (raw)

Hi,

We use the PAF (https://dalibo.github.io/PAF/?) to manage the postgresql.


According to user's requirement, we could not use trust mode in the pg_hba.conf? file. So when running psql, it will ask us to input the password and we have to input the password manually.


So the pcs status show the following error:

* pgsqld_stop_0 on node1-pri 'unknown error' (1): call=34, status=complete, exitreason='Unexpected state for instance "pgsqld" (returned 1)',
    last-rc-change='Wed Mar  6 09:09:46 2019', queued=0ms, exec=504ms



The cause of the error is that the PAF (/usr/lib/ocf/resource.d/heartbeat/pgsqlms)  will ask to input the password and we could not pass the password to psql command in the PAF script.


        exec $PGPSQL, '--set', 'ON_ERROR_STOP=1', '-qXAtf', $tmpfile,
    '-R', $RS, '-F', $FS, '--port', $pgport, '--host', $pghost,'--username','sysdba',

Is there any way for us to pass the password to the psql command in the PAF script?

We have tried to add the "export PGPASSWORD=123456" in the /etc/profile and it does not work.

thanks








view thread (2+ messages)  latest in thread

Message-ID: <79886fabd93e4b83b19c55f97b4210ef@EX02.highgo.com>
Permalink:  ../79886fabd93e4b83b19c55f97b4210ef@EX02.highgo.com/
Also on:    postgresql.org/message-id/79886fabd93e4b83b19c55f97b4210ef@EX02.highgo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: fanguoteng@highgo.com, users@clusterlabs.org, qihuapeng@highgo.com
  Subject: Re: How to make PAF use psql to login with password
  In-Reply-To: <79886fabd93e4b83b19c55f97b4210ef@EX02.highgo.com>
  References: <79886fabd93e4b83b19c55f97b4210ef@EX02.highgo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox