1

I am working on debian jessie

I have installed the language :

aptitude install postgresql-plpython3

then :

% createlang plpython3u template1

then :

% psql
postgres=# CREATE LANGUAGE plpython3u;

I have tried this function :

Create or replace function test() returns void as $$
print('Bonjour le monde')
$$ language plpython3u;

I have tried to force the db :

createlang plpython3u db_test

And i get the message, it is already installed, so I don't know what to do more ??

1 Answers1

0

You can't use print. Use sys.stderr instead the output will be logged in /var/log/postgresql/postgresql-X.X-main.log (replace X.X by your postgresql version)

Create or replace function test(text) returns void as $$
import sys
name = args[0]
sys.stderr.write('Bonjour {}\n'.format(name))
$$ language plpython3u;
select test('sardon');
jmaz
  • 81
  • 5