From: | Ken Huffman <KHuffman(at)westell(dot)com> |
---|---|
To: | Pg Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | PL/Python SD dict wiped? |
Date: | 2018-01-08 15:11:02 |
Message-ID: | 93fd6607ec3f46f2a523a9433741eb48@EXCH13.corp.westell.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Is there a known issue with the PL/Python extension clearing the SD dict under some circumstances? As suggested by the documentation, my plpythonu uses the SD dict for one-time (prepare and ConfigParser) logic:
CREATE OR REPLACE FUNCTION change_notify() RETURN TRIGGER AS $$
...
If len(SD) == 0:
# one time logic
config = ConfigParser.RawConfigParser()
config.read('...')
SD['x'] = config.get('...','...')
SD['plan'] = plpy.prepare('...')
...
x = SD['x']
plan = SD['plan']
To test this trigger after creation, I use psql and force a db update to cause it to fire. If I do multiple updates within psql, the SD dict is only empty for the first update. Yeah!
But if I quit and restart psql and do a subsequent db update, the SD dict is empty again and the one-time logic has to run again. What is clearing the dict? Is that expected?
Ken
Disclaimer
The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.
This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more visit the Mimecast website.
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2018-01-08 15:23:07 | Re: PL/Python SD dict wiped? |
Previous Message | Tom Lane | 2018-01-08 14:57:05 | Re: Condition variable live lock |