Re: libpq: Fix lots of discrepancies in PQtrace
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Jelte Fennema-Nio <postgres@jeltef.nl>
Cc: Michael Paquier <michael@paquier.xyz>, Nathan Bossart <nathandbossart@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-08-09T23:08:40Z
Lists: pgsql-hackers
Attachments
Regarding 0004: I don't want to add 4 bytes to struct pg_conn for tracing support. I'm tempted to make the new struct member a plain 'char' to reduce overhead for a feature that almost nobody is going to use. According to pahole we have a 3 bytes hole in that position of the struct, so if we make it a 1- or 2-byte member, there's no storage overhead whatsoever. Also, why not have pqTraceOutputMessage() responsible for resetting the byte after printing the message? It seems to cause less undesirable detritus. I propose something like the attached, but it's as yet untested. What do you think? -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "El sentido de las cosas no viene de las cosas, sino de las inteligencias que las aplican a sus problemas diarios en busca del progreso." (Ernesto Hernández-Novich)
Commits
-
libpq: Trace all messages received from the server
- b8b3f861fbd7 18.0 landed
-
libpq: Trace responses to SSLRequest and GSSENCRequest
- a5c6b8f22c20 18.0 landed
-
libpq: Trace frontend authentication challenges
- ea92f3a0a5ad 18.0 landed
-
libpq: Trace StartupMessage/SSLRequest/GSSENCRequest correctly
- 7adec2d5fc29 18.0 landed
-
libpq: Add suppress argument to pqTraceOutputNchar
- 4eb179e5bf7a 18.0 landed
-
Use PqMsg_* macros in fe-auth.c.
- 32f07991b728 17.0 landed