Temp tables as session var containers

From: James Croft <james(dot)croft(at)lumison(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Temp tables as session var containers
Date: 2005-05-19 17:19:35
Message-ID: d6ihqf$h6d$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I've seen the session variable question pop up a fair bit on this list.
The temporary table solution seems good but I've got a question before
using it...

- My app creates a temp table for session vars
- UPDATE, INSERT and DELETE triggers on tables use this data

My question is:

If I run a query directly through the psql command line tool (or another
app that doesn't setup this temp table) that temp table wont exist.

How can I write the trigger function to detect the absence of the temp
table and deal with it gracefully? I think I need some SQL to determine
which pg_temp_N schema belongs to my session.

Is this possible?

TIA,
James

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robby Russell 2005-05-19 17:21:35 Re: Postgres in government
Previous Message Josh Berkus 2005-05-19 17:19:16 Re: Postgres in government