dbTalk Databases Forums  

8.3 and current_setting() of unset variables. Again

comp.databases.postgresql comp.databases.postgresql


Discuss 8.3 and current_setting() of unset variables. Again in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Thomas Guettler
 
Posts: n/a

Default 8.3 and current_setting() of unset variables. Again - 01-11-2008 , 09:12 AM






Hi,

to access settings petersprc had this solution:

select setting from pg_catalog.pg_settings where name =
'modwork.transaction_id'

but this does not work. The table looks like this:

custom_variable_classes | modwork | | Customized Options

The variable 'transaction_id' is not accessible. How can you
query for the value of the custom variable?

PS: See old question some messages ago.

Thomas

Reply With Quote
  #2  
Old   
Thomas Guettler
 
Posts: n/a

Default Re: 8.3 and current_setting() of unset variables. Again - 01-11-2008 , 02:47 PM






I still try to find a solution to check if a custom variable was set.

Unfortunately I think it is impossible to catch SQL exceptions in plpython:

try:
transaction_id=plpy.execute("SELECT
current_setting('modwork.transaction_id') AS id")[0]['id']
except:
assert False


'assert False' does not get executed.
I get this:

WARNING: plpython: in function get_or_create_transaction_id:
DETAIL: plpy.SPIError: Unknown error in PLy_spi_execute_query
ERROR: unrecognized configuration parameter "modwork.transaction_id"

Can someone help?

Thomas Guettler schrieb:
Quote:
Hi,

to access settings petersprc had this solution:

select setting from pg_catalog.pg_settings where name =
'modwork.transaction_id'

but this does not work. The table looks like this:

custom_variable_classes | modwork | | Customized Options

The variable 'transaction_id' is not accessible. How can you
query for the value of the custom variable?

PS: See old question some messages ago.

Thomas

Reply With Quote
  #3  
Old   
Thomas Guettler
 
Posts: n/a

Default Re: 8.3 and current_setting() of unset variables. Again - 01-11-2008 , 02:47 PM



I still try to find a solution to check if a custom variable was set.

Unfortunately I think it is impossible to catch SQL exceptions in plpython:

try:
transaction_id=plpy.execute("SELECT
current_setting('modwork.transaction_id') AS id")[0]['id']
except:
assert False


'assert False' does not get executed.
I get this:

WARNING: plpython: in function get_or_create_transaction_id:
DETAIL: plpy.SPIError: Unknown error in PLy_spi_execute_query
ERROR: unrecognized configuration parameter "modwork.transaction_id"

Can someone help?

Thomas Guettler schrieb:
Quote:
Hi,

to access settings petersprc had this solution:

select setting from pg_catalog.pg_settings where name =
'modwork.transaction_id'

but this does not work. The table looks like this:

custom_variable_classes | modwork | | Customized Options

The variable 'transaction_id' is not accessible. How can you
query for the value of the custom variable?

PS: See old question some messages ago.

Thomas

Reply With Quote
  #4  
Old   
Thomas Guettler
 
Posts: n/a

Default Re: 8.3 and current_setting() of unset variables. Again - 01-11-2008 , 02:47 PM



I still try to find a solution to check if a custom variable was set.

Unfortunately I think it is impossible to catch SQL exceptions in plpython:

try:
transaction_id=plpy.execute("SELECT
current_setting('modwork.transaction_id') AS id")[0]['id']
except:
assert False


'assert False' does not get executed.
I get this:

WARNING: plpython: in function get_or_create_transaction_id:
DETAIL: plpy.SPIError: Unknown error in PLy_spi_execute_query
ERROR: unrecognized configuration parameter "modwork.transaction_id"

Can someone help?

Thomas Guettler schrieb:
Quote:
Hi,

to access settings petersprc had this solution:

select setting from pg_catalog.pg_settings where name =
'modwork.transaction_id'

but this does not work. The table looks like this:

custom_variable_classes | modwork | | Customized Options

The variable 'transaction_id' is not accessible. How can you
query for the value of the custom variable?

PS: See old question some messages ago.

Thomas

Reply With Quote
  #5  
Old   
Thomas Guettler
 
Posts: n/a

Default Re: 8.3 and current_setting() of unset variables. Again - 01-11-2008 , 02:47 PM



I still try to find a solution to check if a custom variable was set.

Unfortunately I think it is impossible to catch SQL exceptions in plpython:

try:
transaction_id=plpy.execute("SELECT
current_setting('modwork.transaction_id') AS id")[0]['id']
except:
assert False


'assert False' does not get executed.
I get this:

WARNING: plpython: in function get_or_create_transaction_id:
DETAIL: plpy.SPIError: Unknown error in PLy_spi_execute_query
ERROR: unrecognized configuration parameter "modwork.transaction_id"

Can someone help?

Thomas Guettler schrieb:
Quote:
Hi,

to access settings petersprc had this solution:

select setting from pg_catalog.pg_settings where name =
'modwork.transaction_id'

but this does not work. The table looks like this:

custom_variable_classes | modwork | | Customized Options

The variable 'transaction_id' is not accessible. How can you
query for the value of the custom variable?

PS: See old question some messages ago.

Thomas

Reply With Quote
  #6  
Old   
Thomas Guettler
 
Posts: n/a

Default Re: 8.3 and current_setting() of unset variables. Again - 01-11-2008 , 02:47 PM



I still try to find a solution to check if a custom variable was set.

Unfortunately I think it is impossible to catch SQL exceptions in plpython:

try:
transaction_id=plpy.execute("SELECT
current_setting('modwork.transaction_id') AS id")[0]['id']
except:
assert False


'assert False' does not get executed.
I get this:

WARNING: plpython: in function get_or_create_transaction_id:
DETAIL: plpy.SPIError: Unknown error in PLy_spi_execute_query
ERROR: unrecognized configuration parameter "modwork.transaction_id"

Can someone help?

Thomas Guettler schrieb:
Quote:
Hi,

to access settings petersprc had this solution:

select setting from pg_catalog.pg_settings where name =
'modwork.transaction_id'

but this does not work. The table looks like this:

custom_variable_classes | modwork | | Customized Options

The variable 'transaction_id' is not accessible. How can you
query for the value of the custom variable?

PS: See old question some messages ago.

Thomas

Reply With Quote
  #7  
Old   
Thomas Guettler
 
Posts: n/a

Default Re: 8.3 and current_setting() of unset variables. Again - 01-11-2008 , 02:47 PM



I still try to find a solution to check if a custom variable was set.

Unfortunately I think it is impossible to catch SQL exceptions in plpython:

try:
transaction_id=plpy.execute("SELECT
current_setting('modwork.transaction_id') AS id")[0]['id']
except:
assert False


'assert False' does not get executed.
I get this:

WARNING: plpython: in function get_or_create_transaction_id:
DETAIL: plpy.SPIError: Unknown error in PLy_spi_execute_query
ERROR: unrecognized configuration parameter "modwork.transaction_id"

Can someone help?

Thomas Guettler schrieb:
Quote:
Hi,

to access settings petersprc had this solution:

select setting from pg_catalog.pg_settings where name =
'modwork.transaction_id'

but this does not work. The table looks like this:

custom_variable_classes | modwork | | Customized Options

The variable 'transaction_id' is not accessible. How can you
query for the value of the custom variable?

PS: See old question some messages ago.

Thomas

Reply With Quote
  #8  
Old   
Thomas Guettler
 
Posts: n/a

Default Re: 8.3 and current_setting() of unset variables. Again - 01-11-2008 , 02:47 PM



I still try to find a solution to check if a custom variable was set.

Unfortunately I think it is impossible to catch SQL exceptions in plpython:

try:
transaction_id=plpy.execute("SELECT
current_setting('modwork.transaction_id') AS id")[0]['id']
except:
assert False


'assert False' does not get executed.
I get this:

WARNING: plpython: in function get_or_create_transaction_id:
DETAIL: plpy.SPIError: Unknown error in PLy_spi_execute_query
ERROR: unrecognized configuration parameter "modwork.transaction_id"

Can someone help?

Thomas Guettler schrieb:
Quote:
Hi,

to access settings petersprc had this solution:

select setting from pg_catalog.pg_settings where name =
'modwork.transaction_id'

but this does not work. The table looks like this:

custom_variable_classes | modwork | | Customized Options

The variable 'transaction_id' is not accessible. How can you
query for the value of the custom variable?

PS: See old question some messages ago.

Thomas

Reply With Quote
  #9  
Old   
Thomas Guettler
 
Posts: n/a

Default Re: 8.3 and current_setting() of unset variables. Again - 01-11-2008 , 02:47 PM



I still try to find a solution to check if a custom variable was set.

Unfortunately I think it is impossible to catch SQL exceptions in plpython:

try:
transaction_id=plpy.execute("SELECT
current_setting('modwork.transaction_id') AS id")[0]['id']
except:
assert False


'assert False' does not get executed.
I get this:

WARNING: plpython: in function get_or_create_transaction_id:
DETAIL: plpy.SPIError: Unknown error in PLy_spi_execute_query
ERROR: unrecognized configuration parameter "modwork.transaction_id"

Can someone help?

Thomas Guettler schrieb:
Quote:
Hi,

to access settings petersprc had this solution:

select setting from pg_catalog.pg_settings where name =
'modwork.transaction_id'

but this does not work. The table looks like this:

custom_variable_classes | modwork | | Customized Options

The variable 'transaction_id' is not accessible. How can you
query for the value of the custom variable?

PS: See old question some messages ago.

Thomas

Reply With Quote
  #10  
Old   
Laurenz Albe
 
Posts: n/a

Default Re: 8.3 and current_setting() of unset variables. Again - 01-14-2008 , 02:29 AM



Thomas Guettler <hv (AT) tbz-pariv (DOT) de> wrote:
Quote:
to access settings petersprc had this solution:

select setting from pg_catalog.pg_settings where name =
'modwork.transaction_id'

but this does not work. The table looks like this:

custom_variable_classes | modwork | | Customized Options

The variable 'transaction_id' is not accessible. How can you
query for the value of the custom variable?

PS: See old question some messages ago.
I can confirm that the variable does not show up in pg_catalog.pg_settings,
but I had ne problem setting and retrieving it with SET and SHOW:

test=> SET modwork.transaction_id = 'sample';
SET

test=> SHOW modwork.transaction_id;
modwork.transaction_id
------------------------
sample
(1 row)

Does that help?

Yours,
Laurenz Albe


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.