Postgres logs include information about the connected client from the global MyProcPort variable, which is allocated in TopMemoryContext. I want to read some of those fields from an emit_log_hook to be consistent with built-in log messages, but bindings for the Port type are not currently generated.
Because the type describes the connected client, it utilizes some GSS and SSL types, which cascade into several other dependencies. I'm not interested in those values, so I'm hopeful there's a way to access these fields without unnecessary includes:
Postgres logs include information about the connected client from the global
MyProcPortvariable, which is allocated inTopMemoryContext. I want to read some of those fields from anemit_log_hookto be consistent with built-in log messages, but bindings for thePorttype are not currently generated.Because the type describes the connected client, it utilizes some GSS and SSL types, which cascade into several other dependencies. I'm not interested in those values, so I'm hopeful there's a way to access these fields without unnecessary includes:
user_name, log_line_prefix%udatabase_name, log_line_prefix%dremote_hostandremote_port, log_line_prefix%r