pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Rouhaud <rjuju123@gmail.com>
To: Wiwwo Staff <wiwwo@wiwwo.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Feature request: psql --idle
Date: Wed, 27 Jul 2022 22:07:02 +0800
Message-ID: <20220727140702.x5vpzsuf62ibxvpf@jrouhaud> (raw)
In-Reply-To: <CAFe70G7iATwCMrymVwSVz7NajxCw3552TzFFHvkJqL_3L6gDTA@mail.gmail.com>
References: <CAFe70G7iATwCMrymVwSVz7NajxCw3552TzFFHvkJqL_3L6gDTA@mail.gmail.com>

Hi,

On Wed, Jul 27, 2022 at 02:49:45PM +0200, Wiwwo Staff wrote:
> Since changing ph_hda.conf file to give users access involves the restart
> of server, many companies I work(ed) use a bastion host, where users ssh
> to, and are allowed "somehow" use postgresql.

You mean pg_hba.conf right?  It doesn't need a restart, only a reload as
documented at https://www.postgresql.org/docs/current/auth-pg-hba-conf.html:

>The pg_hba.conf file is read on start-up and when the main server process
>receives a SIGHUP signal. If you edit the file on an active system, you will
>need to signal the postmaster (using pg_ctl reload, calling the SQL function
>pg_reload_conf(), or using kill -HUP) to make it re-read the file.

That being said, it's usually not a good idea to allow connection from all
around the world, so not all users may be able to connect from their local
machine anyway.

> What would help, is a --idle option, where psql does not exit, stays idle
> and waits for user to give a \conn command.
> Something similar to
> sqlplus /nolog
> 
> Is anything like that feasible or is there another solution/workaround?

That might be a good thing to have, as some users may want to rely on psql for
things like \h or \? to work on stuff while not being able to connect to a
remote server (and for some reason who wouldn't want to, or maybe couldn't,
install a local instance).  I would call it something like "--no-connection"
more than "--idle" though.





view thread (5+ messages)  latest in thread

Message-ID: <20220727140702.x5vpzsuf62ibxvpf@jrouhaud>
Permalink:  ../20220727140702.x5vpzsuf62ibxvpf@jrouhaud/
Also on:    postgresql.org/message-id/20220727140702.x5vpzsuf62ibxvpf@jrouhaud

 · 

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: rjuju123@gmail.com, wiwwo@wiwwo.com
  Subject: Re: Feature request: psql --idle
  In-Reply-To: <20220727140702.x5vpzsuf62ibxvpf@jrouhaud>
  References: <CAFe70G7iATwCMrymVwSVz7NajxCw3552TzFFHvkJqL_3L6gDTA@mail.gmail.com> <20220727140702.x5vpzsuf62ibxvpf@jrouhaud>

* 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