pgsql-io / multicorn2

http://multicorn2.org
Other
73 stars 16 forks source link

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

Closed ShaheedHaque closed 5 months ago

ShaheedHaque commented 6 months ago

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.

shanness commented 3 months ago

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

ShaheedHaque commented 3 months ago

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