Re: [PROPOSAL] new diagnostic items for the dynamic sql - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: [PROPOSAL] new diagnostic items for the dynamic sql
Date
Msg-id CAFj8pRCv+KA7MdTBdmzoiSJkCOwZbG+aLkXsfWiwpgPPtSmPfA@mail.gmail.com
Whole thread Raw
In response to Re: [PROPOSAL] new diagnostic items for the dynamic sql  (Zhihong Yu <zyu@yugabyte.com>)
Responses Re: [PROPOSAL] new diagnostic items for the dynamic sql
List pgsql-hackers


+set_errcurrent_query (const char *query)

You can remove the space prior to (.
I wonder if the new field can be named current_err_query because that's what the setter implies.
current_query may give the impression that the field can store normal query (which doesn't cause exception).
The following code implies that only one of internalquery and current_query would be set.

yes, I think so current_query is not a good name too. Maybe query can be good enough - all in ErrorData is related to error



+               if (estate->cur_error->internalquery)
+                   exec_assign_c_string(estate, var, estate->cur_error->internalquery);
+               else
+                   exec_assign_c_string(estate, var, estate->cur_error->current_query);

Cheers

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Schema variables - new implementation for Postgres 15
Next
From: Fujii Masao
Date:
Subject: Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit