1

The application "foo" uses this plpythonu source code to read the custom variable foo.transaction_id.

I guess this is way too complicated.

How to shorten/simplify below lines?

txid_list = list(plpy.execute(
    '''SELECT current_setting FROM current_setting('foo.transaction_id')'''))
txid_str = txid_list [0]['current_setting']
txid = int(txid_str)
guettli
  • 1,591
  • 5
  • 25
  • 51

1 Answers1

2

Based on the documentation, you won't be able to simplify this. plpy offers a quite limited set of DB access functions, so you have to do everything using those - basically the way you do it already.

András Váczi
  • 31,778
  • 13
  • 102
  • 151