View Issue Details

IDProjectCategoryView StatusLast Update
0001209bareos-coreGeneralpublic2023-07-31 15:58
Reportermgronczewski Assigned Tobruno-at-bareos  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionwon't fix 
Product Version19.2.6 
Summary0001209: Scripts should run psql with --no-psqlrc
DescriptionScripts like upgrade_database fail miserably if user have some options set in .psqlrc, for example the result:

sudo -u postgres ./update_bareos_tables
Updating postgresql tables
./update_bareos_tables: 110: [: Expanded: unexpected operator
./update_bareos_tables: 126: [: Expanded: unexpected operator
./update_bareos_tables: 126: [: Expanded: unexpected operator
./update_bareos_tables: 126: [: Expanded: unexpected operator
./update_bareos_tables: 126: [: Expanded: unexpected operator
./update_bareos_tables: 126: [: Expanded: unexpected operator
./update_bareos_tables: 126: [: Expanded: unexpected operator
./update_bareos_tables: 126: [: Expanded: unexpected operator
./update_bareos_tables: 126: [: Expanded: unexpected operator
./update_bareos_tables: 126: [: Expanded: unexpected operator
./update_bareos_tables: 126: [: Expanded: unexpected operator
Don't know how to upgrade from version Expanded display is used automatically.

caused by having different prompt and expanded display enabled.
Steps To Reproducein .psqlrc:

\set PROMPT1 '%M:%> %n@\033[40;1;32m%/\033[0m%R%#%x '
\set PROMPT2 '%M:%> %n@\033[32m%/\033[0m%R%#%x '
\set HISTFILE ~/.psql/.psql_history- :DBNAME
\x auto

\echo 'server: \033[1;32mexample.com\033[0m'
TagsNo tags attached.

Activities

bruno-at-bareos

bruno-at-bareos

2023-07-05 16:55

manager   ~0005160

This is a good idea, would you mind to propose a PR on actual master code ?
bruno-at-bareos

bruno-at-bareos

2023-07-31 15:58

manager   ~0005289

We mainly rely on what distributions have setup for their postgres user environment.
This has work quite well until now.

You're still entitle to propose a code change with a Pull Request on our repository on github.

Issue History

Date Modified Username Field Change
2020-03-05 17:12 mgronczewski New Issue
2023-07-05 16:55 bruno-at-bareos Note Added: 0005160
2023-07-05 16:55 bruno-at-bareos Assigned To => bruno-at-bareos
2023-07-05 16:55 bruno-at-bareos Status new => assigned
2023-07-31 15:58 bruno-at-bareos Status assigned => closed
2023-07-31 15:58 bruno-at-bareos Resolution open => won't fix
2023-07-31 15:58 bruno-at-bareos Note Added: 0005289