Re: Pass ParseState as down to utility functions.
jian he <jian.universality@gmail.com>
From: jian he <jian.universality@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Kirill Reshke <reshkekirill@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-12-12T04:38:06Z
Lists: pgsql-hackers
Attachments
- v11-0002-print-out-the-error-position-for-some-DDL-comman.patch (text/x-patch) patch v11-0002
- v11-0001-Print-out-error-position-for-CreateDomainStmt.patch (text/x-patch) patch v11-0001
On Thu, Dec 12, 2024 at 10:29 AM Michael Paquier <michael@paquier.xyz> wrote: > > I think that the patch should be split a bit more. Even if different > areas of the code are touched, there's more than one idea of how to > create this information for the error position, so each piece could be > committed separately with changes showing up as diffs in the > regression tests. > -- I've split it into two patches, one for CREATE DOMAIN only. one for another DDL command. 0001: I am using DefineDomain(ParseState *pstate, CreateDomainStmt *stmt) for now. we can also pass querystring or another struct. 0002: passing AlterTableUtilityContext for some ALTER TABLE subroutine. add parser_errposition to some existing `ereport(ERROR` places. ------------------- you mentioned ALTER DOMAIN, I have further simplified it at https://postgr.es/m/CACJufxG0N_WLfk-NC_k5w6vv26qLvXupbHvnkKtc2npftJQicQ@mail.gmail.com create domain d_fail as int constraint cc REFERENCES this_table_not_exists(i); like this command will fail, so we don't need to change create_domain.sgml synopsis section ?
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