Score:0

Log postgresql query positional parameters on error (postgresql 10)

in flag

I am trying to debug an application that inserts data into a PostgreSQL 10 database.

PostgreSQL complains that a value is too long for type varying(10) and logs something like this:

2023-08-22 11:23:03.880 CEST [27693] INSTRUCTION :  UPDATE <table_name> SET "dataUpserted" = now(),"name" = $1,"otherfield" = $2,"notes" = $3,"status" = $4,[...] WHERE "id" = $75

What I understand is that PostgreSQL doesn't log query parameters (the $1, $2, ...) but it would really help me understand what part of the input data is faulty. The log_parameter_max_length_on_error configuration parameter seems appropriate, but unfortunately it does not exist in PostgreSQL 10. Is there no other way to log query parameters in PostgreSQL 10?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.