Re: How to install login_hook in Postgres 10.5

Started by pavan95over 6 years ago8 messages
#1pavan95
pavan.postgresdba@gmail.com

Hello Community,

While I was searching for logon trigger in postgres similar to that of
Oracle, I came across "login_hook", which can be installed as a Postgres
database extension to mimic a logon trigger.

But I tried to install but failed. Error is that it could not find its .so
file. Could you please help me in installing this login_hook ??

Looking forward to hear from you. Any suggestions would be of great help!

Thanks & Regards,
Pavan

--
Sent from: http://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html

#2legrand legrand
legrand_legrand@hotmail.com
In reply to: pavan95 (#1)

Hello,

This extension https://github.com/splendiddata/login_hook
seems very interesting !
But I didn't test it myself and maybe the best place to ask
support is there
https://github.com/splendiddata/login_hook/issues

For information there is something equivalent in core
"[PATCH] A hook for session start"
/messages/by-id/20171103164305.1f952c0f@asp437-24-g082ur

that finished commited
"pgsql: Add hooks for session start and session end"
/messages/by-id/575d6fa2-78d0-4456-8600-302fc35b2591@dunslane.net

but was finally rollbacked because it didn't pass installcheck test
...

Maybe you are able to patch your pg installation,
it would be a solution of choice (there is a nice exemple
of extension included)

Showing interest for this may also help getting this feature back ;o)

Regards
PAscal

--
Sent from: http://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html

#3Michael Paquier
michael@paquier.xyz
In reply to: legrand legrand (#2)

On Mon, May 13, 2019 at 01:06:10PM -0700, legrand legrand wrote:

that finished commited
"pgsql: Add hooks for session start and session end"
/messages/by-id/575d6fa2-78d0-4456-8600-302fc35b2591@dunslane.net

but was finally rollbacked because it didn't pass installcheck test
...

Maybe you are able to patch your pg installation,
it would be a solution of choice (there is a nice exemple
of extension included)

You will need to patch Postgres to add this hook, and you could
basically reuse the patch which has been committed once. I don't
think that it would be that much amount of work to get it working
correctly on the test side to be honest, so we may be able to get
something into v13 at this stage. This is mainly a matter of
resources though, and of folks willing to actually push for it.
--
Michael

#4Joe Conway
mail@joeconway.com
In reply to: Michael Paquier (#3)

On 5/13/19 8:32 PM, Michael Paquier wrote:

On Mon, May 13, 2019 at 01:06:10PM -0700, legrand legrand wrote:

that finished commited
"pgsql: Add hooks for session start and session end"
/messages/by-id/575d6fa2-78d0-4456-8600-302fc35b2591@dunslane.net

but was finally rollbacked because it didn't pass installcheck test
...

Maybe you are able to patch your pg installation,
it would be a solution of choice (there is a nice exemple
of extension included)

You will need to patch Postgres to add this hook, and you could
basically reuse the patch which has been committed once. I don't
think that it would be that much amount of work to get it working
correctly on the test side to be honest, so we may be able to get
something into v13 at this stage. This is mainly a matter of
resources though, and of folks willing to actually push for it.

I am interested in this, so if Andrew wants to create a buildfarm module
I will either add it to rhinoceros or stand up another buildfarm animal
for it. I am also happy to help push it for v13.

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development

#5Andrew Dunstan
andrew.dunstan@2ndquadrant.com
In reply to: Joe Conway (#4)

On 5/14/19 8:34 AM, Joe Conway wrote:

On 5/13/19 8:32 PM, Michael Paquier wrote:

On Mon, May 13, 2019 at 01:06:10PM -0700, legrand legrand wrote:

that finished commited
"pgsql: Add hooks for session start and session end"
/messages/by-id/575d6fa2-78d0-4456-8600-302fc35b2591@dunslane.net

but was finally rollbacked because it didn't pass installcheck test
...

Maybe you are able to patch your pg installation,
it would be a solution of choice (there is a nice exemple
of extension included)

You will need to patch Postgres to add this hook, and you could
basically reuse the patch which has been committed once. I don't
think that it would be that much amount of work to get it working
correctly on the test side to be honest, so we may be able to get
something into v13 at this stage. This is mainly a matter of
resources though, and of folks willing to actually push for it.

I am interested in this, so if Andrew wants to create a buildfarm module
I will either add it to rhinoceros or stand up another buildfarm animal
for it. I am also happy to help push it for v13.

I've just been looking at this again. I think the right way to test it
is not to use the regression framework but to use a TAP test that would
preload the test module. Then it would just happen as part of all the
other TAP tests with no extra buildfarm module needed.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

#6legrand legrand
legrand_legrand@hotmail.com
In reply to: Andrew Dunstan (#5)

Hello,

shouldn't we update associated commitfest entry
https://commitfest.postgresql.org/15/1318/

to give it a chance to be included in pg13 ?

Regards
PAscal

--
Sent from: https://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html

#7Michael Paquier
michael@paquier.xyz
In reply to: legrand legrand (#6)

On Thu, Aug 01, 2019 at 05:01:17AM -0700, legrand legrand wrote:

Shouldn't we update associated commitfest entry
https://commitfest.postgresql.org/15/1318/

to give it a chance to be included in pg13 ?

Well, it is mainly a matter of finding somebody willing to do the
legwork, in which case I would let the past commit fest entry as it
is, and create a new one once a new patch is ready to be reviewed.
--
Michael

#8legrand legrand
legrand_legrand@hotmail.com
In reply to: pavan95 (#1)

pavan95 wrote

Hello Community,

While I was searching for logon trigger in postgres similar to that of
Oracle, I came across "login_hook", which can be installed as a Postgres
database extension to mimic a logon trigger.

But I tried to install but failed. Error is that it could not find its .so
file. Could you please help me in installing this login_hook ??

Looking forward to hear from you. Any suggestions would be of great help!

Thanks & Regards,
Pavan

--
Sent from:
http://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html

issue
ERROR: could not access file "login_hook.so": No such file or directory
has been fixed see:
https://github.com/splendiddata/login_hook/issues/1

Regards
PAscal

--
Sent from: https://www.postgresql-archive.org/PostgreSQL-hackers-f1928748.html