Re: Better error reporting from extension scripts (Was: Extend ALTER OPERATOR)
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christoph Berg <myon@debian.org>
Cc: Michael Banck <mbanck@gmx.net>, Tommy Pavlicek <tommypav122@gmail.com>, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, pgsql-hackers@lists.postgresql.org, jian.universality@gmail.com
Date: 2024-09-27T16:31:08Z
Lists: pgsql-hackers
Attachments
- v1-better-extension-error-reporting.patch (text/x-diff) patch v1
Christoph Berg <myon@debian.org> writes: > Re: Tom Lane >> So the first part of that is great, but if your script file is >> large you probably won't be happy about having the whole thing >> repeated in the "QUERY" field. So this needs some work on >> user-friendliness. > Does this really have to be addressed? It would be way better than it > is now, and errors during extension creation are rare and mostly for > developers only, so it doesn't have to be pretty. Perhaps. I spent a little more effort on this and added code to report errors that don't come with an error location. On those, we don't have any constraints about what to report in the QUERY field, so I made it trim the string to just the current query within the script, which makes things quite a bit better. You can see the results in the test_extensions regression test changes. (It might be worth some effort to trim away comments appearing just before a command, but I didn't tackle that here.) regards, tom lane
Commits
-
Strip Windows newlines from extension script files manually.
- 6cfb3a337469 18.0 landed
-
Read extension script files in text not binary mode.
- 924e03917d6f 18.0 landed
-
Improve reporting of errors in extension script files.
- 774171c4f640 18.0 landed
-
Improve parser's reporting of statement start locations.
- 14e5680eee19 18.0 landed
-
Extend ALTER OPERATOR to allow setting more optimization attributes.
- 2b5154beab79 17.0 landed
-
Core support for "extensions", which are packages of SQL objects.
- d9572c4e3b47 9.1.0 cited