Re: Temp rows - is it possible?

From: elein <elein(at)varlena(dot)com>
To: Boris Popov <boris(at)procedium(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Temp rows - is it possible?
Date: 2003-11-08 19:38:37
Message-ID: 20031108113837.D18014@cookie.varlena.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

What you really want is an end of session callback.
There is not one in PostgreSQL. However, if this is
for session management, you can handle this in your
application by bracketing the connection code with
the table management.

That is, in your app (or rather in your session pooling
code) follow up each close with a DELETE of the rows
in question. The only tricky part is deciding on the
key so that it is known both before and after the connection.

Does this make sense?

elein

On Fri, Nov 07, 2003 at 01:09:15PM -0800, Boris Popov wrote:
> Hello pgsql-general,
>
> I'm trying to implement a table with rows that are automatically
> deleted when the session that inserted them disconnects, sort of like
> our own alternative to pg_stat_activity. Is it possible and what
> approach should I be trying to achieve such a thing?
>
> Thanks!
>
> --
> -Boris
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-11-08 19:38:49 Re: int8 primary keys still not using index without manual
Previous Message Alvaro Herrera 2003-11-08 19:37:26 Re: Referencing columns from system tables possible?