Per-session data?

Поиск
Список
Период
Сортировка
От Steve Atkins
Тема Per-session data?
Дата
Msg-id 20040503164047.GA9303@gp.word-to-the-wise.com
обсуждение исходный текст
Ответы Re: Per-session data?  (Peter Eisentraut <peter_e@gmx.net>)
Re: Per-session data?  (Mike Mascari <mascarm@mascari.com>)
Список pgsql-general
I have an application where each user session opens and maintains a
long-lived connection to the postgresql backend database.

I need to keep a small amount of information (things like a unique
session identifier, the application - as opposed to database - username
and so on) that is local to each database session. It needs to be
visible from within plpgsql trigger functions and will be used
on a large fraction of updates.

I can see a few ways of doing it, none of them terribly pretty:

  Keep all the data in a globally visible table, indexed by the
  PID of the database backend.

  Create a temporary table at the beginning of each session containing
  the data, and simply read it out of that, relying on the temporary
  table to be session-local.

Anyone have a suggestion for something that's either prettier, lower
overhead or both?

Cheers,
  Steve


В списке pgsql-general по дате отправления:

Предыдущее
От: Dennis Gearon
Дата:
Сообщение: pdx pug or pug domain owner
Следующее
От: Ericson Smith
Дата:
Сообщение: XID Data Types