Closed danolivo closed 2 weeks ago
Could you send a patch with all the suggestions you have in mind?
There is already a bit, like https://pg-hint-plan.readthedocs.io/en/pg16/hint_details.html#upper-and-lower-case-handling-in-object-names.
I don't have it in code right now. But if you can apply a pull request, I would gladly write the code; it looks pretty simple.
I can review, edit and apply pull requests. I have commit rights on this repository.
For now, please note that I am closing the bug as of a lack of activity. If you'd like to improve the documentation and/or the code, please feel free to send a pull request or a patch.
I rarely use pg_hint_plan. So, my apologies if you have already fixed that. If a query contains: .. FROM table AS ..
the IndexScan hint will search for , not for the real table name. It should be explained in the documentation.
Moreover, it's worth considering implementing error handling for scan hints. The tool is case-sensitive, treating 'TABLE' and 'table' as different names. While all names during the query -> parsetree process are forced to be in lowercase, not all users may be aware of this. To enhance user confidence, it could be beneficial to check the existence of the table and index mentioned by the hint in the query. After all, the Set() hint throws an error in the case of an incorrect GUC name, so why not do the same for scan hints?