I've written a function that uses several temporary tables with the ON COMMIT DROP option. This function does no updates to the database. Now I would like to put in some logging. In otherwords:
insert into my_logging_table values (...); commit;
Obviously I can't do the commit without dropping my temp tables.
What is a good way to implement my intended functionality?
You can't put "commit" inside a function so I feel like you are failing to share some important details by not providing code.