<sect2 id="RT_PLPython">
<title>Use PLPython to dump out images via SQL</title>
- <para>This is a plpython stored function that creates a file in the server directory for each record.</para>
- <programlisting>//plpython postgresql stored proc. Requires you have plpython installed
-<![CDATA[CREATE OR REPLACE FUNCTION write_file (param_bytes bytea, param_filepath text)
+ <para>This is a plpython stored function that creates a file in the server directory for each record.
+ Requires you have plpython installed. Should work fine with both plpythonu and plpython3u.</para>
+ <programlisting><![CDATA[CREATE OR REPLACE FUNCTION write_file (param_bytes bytea, param_filepath text)
RETURNS text
AS $$
f = open(param_filepath, 'wb+')