"Day, David" <dday@xxxxxxxxxx> writes: > I am amending the info threads info there are two threads. Well, that's your problem right there. There should never, ever be more than one thread in a Postgres backend process: none of the code in the backend is meant for a multithreaded situation, and so there are no interlocks on global variable access etc. Presumably what is happening is that your plperlu function is somehow managing to spawn an additional execution thread and let that return control as well as the original thread. You need to prevent that. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general