howto set a variable in transaction context

Started by Thomas Markusalmost 18 years ago3 messagesgeneral
Jump to latest
#1Thomas Markus
t.markus@proventis.net

hi list,

how can i set a variable, which content is only visible in current
transaction?
i know the way to create a temp table with

create temp table ... on commit drop

but i dont like that way. something like
|
set_config(setting_name, new_value, is_local)

is it possible?

regards
thomas
|

#2A. Kretschmer
andreas.kretschmer@schollglas.com
In reply to: Thomas Markus (#1)
Re: howto set a variable in transaction context

am Thu, dem 10.04.2008, um 13:32:04 +0200 mailte Thomas Markus folgendes:

hi list,

how can i set a variable, which content is only visible in current
transaction?
i know the way to create a temp table with

create temp table ... on commit drop

but i dont like that way. something like
|
set_config(setting_name, new_value, is_local)

is it possible?

Yes, you can use this:
http://www.postgresql.org/docs/current/interactive/runtime-config-custom.html

How to use?
http://groups.google.de/group/pgsql.general/browse_thread/thread/f914569b73d17258/5c0cb606d0ce698d?lnk=st&q=#5c0cb606d0ce698d

HTH, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

#3Thomas Markus
t.markus@proventis.net
In reply to: A. Kretschmer (#2)
Re: howto set a variable in transaction context

thanks, it works

A. Kretschmer schrieb:

Show quoted text

am Thu, dem 10.04.2008, um 13:32:04 +0200 mailte Thomas Markus folgendes:

hi list,

how can i set a variable, which content is only visible in current
transaction?
i know the way to create a temp table with

create temp table ... on commit drop

but i dont like that way. something like
|
set_config(setting_name, new_value, is_local)

is it possible?

Yes, you can use this:
http://www.postgresql.org/docs/current/interactive/runtime-config-custom.html

How to use?
http://groups.google.de/group/pgsql.general/browse_thread/thread/f914569b73d17258/5c0cb606d0ce698d?lnk=st&q=#5c0cb606d0ce698d

HTH, Andreas