eg_db_config can fail depending on ~/.psqlrc contents
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Low
|
Unassigned | ||
3.10 |
Fix Released
|
Low
|
Unassigned | ||
3.11 |
Fix Released
|
Low
|
Unassigned |
Bug Description
Certain psql directives that users may have in their ~/.psqlrc files can cause eg_db_config to fail with a confusing error message, such as the following:
Argument "?M-^TM-^B" isn't numeric in numeric ge (>=) at Open-ILS/
when using both linestyle = unicode and border=2, or
Argument "|" isn't numeric in numeric ge (>=) at Open-ILS/
when using just border = 2, neither of which is helpful. (The version of Pg in this case is 14, for the curious.)
Because the format of the results can change depending on forces outside our control, we should be passing the -X flag (ignore system / personal psqlrc files) anytime we call psql directly to operate on the results. The collection of -qXAt is a very nice flagset if you want to process a single-line query result, which we do in this case at least.
description: | updated |
Changed in evergreen: | |
milestone: | none → 3.12-beta |
tags: | added: install-upgrade |
Changed in evergreen: | |
milestone: | 3.12-beta → 3.12-rc |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
Here's a branch that ignores the user customization files and makes Pg version detection more robust: /git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ jboyer/ lp2023418_ psql_flags / working/ user/jboyer/ lp2023418_ psql_flags
https:/
To test:
Create a .psqlrc file for the user running eg_db_config to create a new database and include the following lines:
\pset linestyle unicode
\pset border 2
and try to create the new database; you should receive an error as stated above.
Apply the patch.
At minimum run 'make' again to regenerate eg_db_config, and try again.
Success!