Re: Pass ParseState as down to utility functions.
Kirill Reshke <reshkekirill@gmail.com>
From: Kirill Reshke <reshkekirill@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: jian he <jian.universality@gmail.com>,
Michael Paquier <michael@paquier.xyz>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-12-09T07:50:20Z
Lists: pgsql-hackers
Attachments
- v7-0001-Print-out-error-position-for-number-of-DDL-comman.patch (application/octet-stream) patch v7-0001
Thank you for reviewing this! On Fri, 6 Dec 2024 at 19:01, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote: > I think it would make more sense to write the commit message in terms of > the DDL commands that now report error position, than the C functions. > Such a list of commands does not need to be exhaustive; a > representative-enough sample probably suffices. Hi! I fixed the commit message as suggested. > Once upon a time, ereport() was a simpler macro that did not > use variadic arguments. Back then, the list of functions embedded in it > (errcode, errmsg etc) were forced to be in an additional level of > parentheses so that the macro would work at all (IIRC failure to do that > resulted in strange compile-time problems). This is why a majority of > code is written in the style with those parens. But commit e3a87b4991cc > changed ereport to use __VA_ARGS__, so the auxiliary functions are > actual arguments to errstart() -- which means that the parentheses > you're adding here are unnecessary and discouraged. Just add the > parser_errposition() call and it'll be fine. Should be fixed in v7. -- Best regards, Kirill Reshke
Commits
-
Print out error position for some ALTER TABLE ALTER COLUMN type
- 65281391a937 18.0 landed
-
Print out error position for some more DDLs
- 0f23dedc9176 18.0 landed
-
Print out error position for CREATE DOMAIN
- 39240bcad56d 18.0 landed
-
Add some regression tests for missing DDL patterns
- 0172b4c9449e 18.0 landed
-
Re-implement the ereport() macro using __VA_ARGS__.
- e3a87b4991cc 13.0 cited