From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: ivan <ivan@psycho.pl>
Cc: pgsql-admin@postgresql.org
Subject: Re: qestion
Date: Thu, 15 May 2003 10:36:04 -0700 (PDT)
Message-ID: <20030515103311.M62782-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0305141148400.8738-100000@rex.anfa.pl>
On Wed, 14 May 2003, ivan wrote:
> i connect to my postgres only by socket tcp/ip , and i have to know what
> client is connected to postgres in plpgsql function. I have many useres
> in pg_hba.conf which can connect to server from all local network.
> Then i need know from which client is connection. Is same way to check it
> ? or rewrite postmaster ?
Do you need the ip address or only what user is connected? The latter can
be got at with CURRENT_USER or USER.
> ... oh , is possible to change pg_hba.conf in plpgsql function, ie, when i
> create new user (throught plpgsql func.) i need to add ip address, which
> will be used by this new user.
Probably not. You'd probably have to write a function in something else
and call it from the plpgsql function. However, there's still an issue of
how to handle rollbacks since you can't easily roll back the changes. It
might be better to have something that's connected and LISTENing and then
do a NOTIFY when you add users and have the outside thing figure out what
entries belong in pg_hba.conf.
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-admin@postgresql.org
Cc: sszabo@megazone23.bigpanda.com, ivan@psycho.pl
Subject: Re: qestion
In-Reply-To: <20030515103311.M62782-100000@megazone23.bigpanda.com>
References: <Pine.LNX.4.44.0305141148400.8738-100000@rex.anfa.pl> <20030515103311.M62782-100000@megazone23.bigpanda.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