Support event trigger for logoff

Started by Japin Liover 2 years ago3 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

won't retrysuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t49493
psql -h localhost -U postgres

Built from patchset v1 (message #1), July 27, 2026 at 10:56 PM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t49493_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t49493_1 && git checkout t49493_1

Patchset v1 (message #1) is on t49493_1

Jump to latest
#1Japin Li
japinli@hotmail.com

Hi, hackers

I see [1]/messages/by-id/0d46d29f-4558-3af9-9c85-7774e14a7709@postgrespro.ru has already implemented on login event trigger, why not implement
the logoff event trigger?

My friend Song Jinzhou and I try to implement the logoff event trigger, so
attach it.

Here is a problem with the regression test when using \c to create a new
session, because it might be running concurrently, which may lead to the
checking being unstable.

Any thoughts?

[1]: /messages/by-id/0d46d29f-4558-3af9-9c85-7774e14a7709@postgrespro.ru

--
Regards,
Japin Li

Attachments:

t49493_1
v1-0001-Add-support-event-triggers-for-logoff.patchtext/x-diffDownload+309-10
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Japin Li (#1)
Re: Support event trigger for logoff

Japin Li <japinli@hotmail.com> writes:

I see [1] has already implemented on login event trigger, why not implement
the logoff event trigger?

What happens if the session crashes, or otherwise fails unexpectedly?

Here is a problem with the regression test when using \c to create a new
session, because it might be running concurrently, which may lead to the
checking being unstable.

Any thoughts?

Let's not go there at all. I don't think there's enough field
demand to justify dealing with this concept.

regards, tom lane

#3Japin Li
japinli@hotmail.com
In reply to: Tom Lane (#2)
Re: Support event trigger for logoff

On Sat, 20 Apr 2024 at 01:36, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Japin Li <japinli@hotmail.com> writes:

I see [1] has already implemented on login event trigger, why not implement
the logoff event trigger?

What happens if the session crashes, or otherwise fails unexpectedly?

I am currently unsure how to handle such situations, but I believe it is not
only for logoff events.

Here is a problem with the regression test when using \c to create a new
session, because it might be running concurrently, which may lead to the
checking being unstable.

Any thoughts?

Let's not go there at all. I don't think there's enough field
demand to justify dealing with this concept.

Thanks for your point out this for me.

--
Regards,
Japin Li