pgsql-io/multicorn2

Python-side FDW debugging made near-impossible by missing "log_to_postgres"

ShaheedHaque opened this issue · 2 comments

Generally, debugging the Python-side of an FDW needs to be able to produce user-visible output. This used to be possible using log_to_postgres, but I just noticed that this is missing.

After a bit of digging, it is clear that this was caused (by me!) in #28 by accidentally deleting the line which caused the relevant module built from utils.c.

Thanks for such a great project! I still can't get any logging out :( (only exceptions end up in the log).

I'm not sure what to advise. From what I remember, everything ended up in the postgres main log file. Maybe double check the message is emitted by the running code, and you have the right multicorn version installed? For example, using nm, I check like this:

$ nm /.../.local/lib/python3.11/site-packages/multicorn/_utils.cpython-311-x86_64-linux-gnu.so| grep log_to_postgres
0000000000001380 t log_to_postgres

and for reference, the containing directory looks like this:

$ ls -1 /.../.local/lib/python3.11/site-packages/multicorn/
compat.py
csvfdw.py
fsfdw
gcfdw.py
gitfdw.py
googlefdw.py
imapfdw.py
__init__.py
ldapfdw.py
processfdw.py
__pycache__
rssfdw.py
sqlalchemyfdw.py
statefdw.py
testfdw.py
_utils.cpython-311-x86_64-linux-gnu.so       <<< here it is
utils.py
xmlfdw.py