Re: log bind parameter values on error - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: log bind parameter values on error
Date
Msg-id 20190918205853.GA21408@alvherre.pgsql
Whole thread Raw
In response to Re: log bind parameter values on error  (Alexey Bashtanov <bashtanov@imap.cc>)
Responses Re: log bind parameter values on error
Re: log bind parameter values on error
List pgsql-hackers
Nice patch, thanks.

I didn't like abusing testlibpq3.c for your new stuff, so I moved it off
to a new file testlibpq5.c.  I cleaned up a few other cosmetics things
about this -- v10 attached.  I eventually noticed that this patch fails
to initialize each param's textValue to NULL, which probably explains
why you have to be so careful about only setting hasTextValues after the
whole loop.  That seems a bit too trusting; I think it would be better
to set all these to NULL in makeParamList instead of leaving the memory
undefined.  One way would be to have a for() look in makeParamList that
nullifies the member; another would be to use palloc0().

A third possibility is to inspect each caller of makeParamList and have
them all set textValue to NULL to each parameter.

I'm marking this waiting on author.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Nikolay Shaplov
Date:
Subject: Re: [PATCH] src/test/modules/dummy_index -- way to test reloptions from inside of access method
Next
From: Tom Lane
Date:
Subject: Re: Define jsonpath functions as stable