Re: A doubt about a newly added errdetail
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2022-09-27T12:42:49Z
Lists: pgsql-hackers
Attachments
- expr_allowed_in_node.patch (text/x-diff) patch
While reading this code, I noticed that function expr_allowed_in_node() has a very strange API: it doesn't have any return convention at all other than "if we didn't modify errdetail_str then all is good". I was tempted to add an "Assert(*errdetail_msg == NULL)" at the start of it, just to make sure that it is not called if a message is already set. I think it would be much saner to inline the few lines of that function in its sole caller, as in the attached. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "E pur si muove" (Galileo Galilei)
Commits
-
Remove publicationcmds.c's expr_allowed_in_node as a function
- d0b1dbcb9845 16.0 landed
- a60b11327bbd 15.0 landed
-
Improve some publication-related error messages
- f5441b912493 15.0 landed
- 4148c8b3daf9 16.0 landed