eg_db_config can fail depending on ~/.psqlrc contents

Bug #2023418 reported by Jason Boyer
6
This bug affects 1 person
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/src/support-scripts/eg_db_config line 152.
when using both linestyle = unicode and border=2, or
Argument "|" isn't numeric in numeric ge (>=) at Open-ILS/src/support-scripts/eg_db_config line 152.
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.

Revision history for this message
Jason Boyer (jboyer) wrote :

Here's a branch that ignores the user customization files and makes Pg version detection more robust:
https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/jboyer/lp2023418_psql_flags / working/user/jboyer/lp2023418_psql_flags

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!

tags: added: pullrequest
Changed in evergreen:
importance: Undecided → Critical
importance: Critical → Low
Jason Boyer (jboyer)
description: updated
Changed in evergreen:
milestone: none → 3.12-beta
tags: added: install-upgrade
Changed in evergreen:
milestone: 3.12-beta → 3.12-rc
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks, Jason! Confirmed using your test plan. Pushed to rel_3_10 and above.

Changed in evergreen:
status: New → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.