[PATCH] A hook for session start

From: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [PATCH] A hook for session start
Date: 2017-07-20 11:47:33
Message-ID: 20170720204733.40f2b7eb.nagata@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Currently, PostgreSQL doen't have a hook triggered at session
start. Although we already have ClientAuthentication_hook,
this is triggered during authentication, so we can not
access the database.

If we have a hook triggerd only once at session start, we may
do something useful on the session for certain database or user.

For example, one of our clients wanted such feature. He wanted
to handle encription for specific users, though I don't know
the detail.

The attached patch (session_start_hook.patch) implements such

Another patch, session_start_sample.patch, is a very simple
example of this hook that changes work_mem values for sessions
of a specific database.

I would appreciate hearing your opinion on this hook.


Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
session_start_hook.patch text/x-diff 1.4 KB
session_start_sample.patch text/x-diff 1.9 KB


Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2017-07-20 11:52:38 Re: [PATCH] pageinspect function to decode infomasks
Previous Message Ashutosh Bapat 2017-07-20 11:47:04 Re: <> join selectivity estimate question