Re: Temp rows - is it possible? - Mailing list pgsql-general

From elein
Subject Re: Temp rows - is it possible?
Date
Msg-id 20031108113837.D18014@cookie.varlena.com
Whole thread Raw
In response to Temp rows - is it possible?  (Boris Popov <boris@procedium.com>)
List 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: int8 primary keys still not using index without manual
Next
From: Rajesh Kumar Mallah
Date:
Subject: Problem in restoring data