![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, Postgres 8.3 behaves different, if you access an unset custom variable. Version 8.1 returned 'unset', while 8.3 fails: plpython trigger: CREATE OR REPLACE FUNCTION get_or_create_transaction_id() returns INT as $$ transaction_id=plpy.execute("SELECTcurrent_setting ('modwork.transaction_id') AS id")[0]['id'] if not transaction_id or transaction_id=='unset': # First write, create transaction ID ProgrammingError: unrecognized configuration parameter 'modwork.transaction_id' PostgreSQL8.1.4 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.1.0 (SUSE Linux) modwork_esg=# SHOW modwork.asfd; modwork.asfd -------------- unset PostgreSQL8.3beta3 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 3.3.4 (pre 3.3.5 20040809) modwork_esg=# SHOW modwork.asdf; ERROR: unrecognized configuration parameter "modwork.asdf" How can you check if a variable exists with 8.3? BTW:current_setting() is not in the index:http://www.postgresql.org/docs/8.3/s...bookindex.html |
![]() |
| Thread Tools | |
| Display Modes | |
| |