Re: print in plpython not appearing in logs - Mailing list pgsql-general

From Tom Lane
Subject Re: print in plpython not appearing in logs
Date
Msg-id 2242530.1670077780@sss.pgh.pa.us
Whole thread Raw
In response to print in plpython not appearing in logs  (Ludwig Isaac Lim <ludz_lim@yahoo.com>)
Responses Re: print in plpython not appearing in logs  (Ludwig Isaac Lim <ludz_lim@yahoo.com>)
List pgsql-general
Ludwig Isaac Lim <ludz_lim@yahoo.com> writes:
> I'm having problems wherein my print() statements inside my plpython stored proc are not appearing in postgresql log.
Itried setting the file=sys.stderr 

Hmm.  I can tell you that with "logging_collector = on", I would only
expect the logs to capture stderr output, not stdout.  So it makes
sense to me that plain "print" would disappear into the bit bucket.
But if you specify stderr output, it ought to work.  I don't know
enough Python to know why it's not working, but it seems to me this is
primarily a Python question not a Postgres question.  Maybe you need
an explicit fflush-equivalent step?  Dunno.

            regards, tom lane



pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: Stored procedure code no longer stored in v14 and v15, changed behaviour
Next
From: Brad White
Date:
Subject: Re: Stored procedure code no longer stored in v14 and v15, changed behaviour