ð ïž
Quick Fix
Run this command once from your shell:
hist="${PSQL_HISTORY:-$HOME/.psql_history}"; rc="${PSQLRC:-$HOME/.psqlrc}"; [ -e "$hist" ] || : >"$hist"; head -n1 "$hist" | grep -qxF '_HiStOrY_V2_' || { t=$(mktemp) && { printf '_HiStOrY_V2_\n'; cat "$hist"; } >"$t" && mv "$t" "$hist"; }; t=$(mktemp) && { grep -vE '^[[:space:]]*\\set[[:space:]]+HISTSIZE([[:space:]]+|$)' "$rc" 2>/dev/null; printf '\\set HISTSIZE -1\n'; } >"$t" && mv "$t" "$rc"
This command:
- â Restores the missing history file header
- â Ensures the history file exists
- â Sets unlimited history retention for
ysqlsh
You do not need to add this to .bash_profile… it is a one-time repair step.