pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Schneider, Jeremy <schnjere@amazon.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ron <ronljohnsonjr@gmail.com>
Cc: Forums postgresql <pgsql-general@postgresql.org>
Subject: Re: Trigger when user logs in
Date: Sun, 14 Apr 2019 00:28:39 +0000
Message-ID: <46D55D2C-5496-4867-9B87-3D865D71BCD2@amazon.com> (raw)
In-Reply-To: <22830.1555037562@sss.pgh.pa.us>
References: <eb44b902-9c08-8489-7d32-79d889d9e229@gmail.com>
	<21272.1555035161@sss.pgh.pa.us>
	<d0b376b1-dedf-64c7-8d00-8aaa132177d4@gmail.com>
	<22830.1555037562@sss.pgh.pa.us>


> On Apr 11, 2019, at 19:52, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> Ron <ronljohnsonjr@gmail.com> writes:
>> I bet requests like this will start to make it onto the beaten path.
> 
> Meh.  I'm not that excited about inventing our own versions of wheels
> that already exist, especially when there's nothing very Postgres-specific
> about the requirements.  Notice that the example I pointed you at is for
> sshd not Postgres.  IMO the fact that you can use the same tool to solve
> both cases is a good thing.

This might work for sending an email, but not very useful if I want to do something in the database.

For example, one very common use of logon triggers in other databases is to look at various connection parameters (like username or source IP) and enable sql logging or debugging for only certain cases (not always doing the same thing for a particular user). Another common use case is to do something like running plpgsql or manipulating data in db tables - but again looking at some combination of things at a database level to make a decision about what to do; for example the application itself might enable or disable certain behaviors by setting values in a configuration table.

I’m still trying to work out the best approach for solving these sorts of use cases in current versions of PostgreSQL... I’m curious how others are solving this?

-Jeremy

Sent from my TI-83

view thread (12+ messages)  latest in thread

Message-ID: <46D55D2C-5496-4867-9B87-3D865D71BCD2@amazon.com>
Permalink:  ../46D55D2C-5496-4867-9B87-3D865D71BCD2@amazon.com/
Also on:    postgresql.org/message-id/46D55D2C-5496-4867-9B87-3D865D71BCD2@amazon.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: schnjere@amazon.com, tgl@sss.pgh.pa.us, ronljohnsonjr@gmail.com
  Subject: Re: Trigger when user logs in
  In-Reply-To: <46D55D2C-5496-4867-9B87-3D865D71BCD2@amazon.com>
  References: <eb44b902-9c08-8489-7d32-79d889d9e229@gmail.com> <21272.1555035161@sss.pgh.pa.us> <d0b376b1-dedf-64c7-8d00-8aaa132177d4@gmail.com> <22830.1555037562@sss.pgh.pa.us> <46D55D2C-5496-4867-9B87-3D865D71BCD2@amazon.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