-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Postgresql-setup script updates #1935
Conversation
@sgillespie We might need your help on the Nix stuff. |
I think we just need to update nixpkgs/haskell.nix |
Unfortunately, we will not be able to use postgresql_17 until we update the nixpkgs pin for haskell.nix, currently in progress: input-output-hk/haskell.nix#2307 |
Will re-base and amend once #1936 is merged |
It's done, you should now be able to rebase from master |
d094e20
to
aa63ef4
Compare
Thanks a lot @sgillespie , updated this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Thanks for the contribution @rdlrt
2d1b4ef
to
af56012
Compare
scripts/postgresql-setup.sh
Outdated
--no-owner \ | ||
--exit-on-error \ | ||
--no-owner \ | ||
"$( [ -z "${SKIP_RESTORE_ERROR}" ] && echo " --exit-on-error" )" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't quoting this make it add ""
to the list of arguments? I suspect this will result in:
pg_restore: error: too many command-line arguments (first is "")
Thanks for putting this together @rdlrt . I have one concern about the CLI arguments to |
Thanks @sgillespie - Done |
Can you also add another shellcheck exception?
|
docker-compose*.yml: Bump node version to 10.1.4 and dbsync version to 13.6.0.4 postgresql-setup.sh: - Parse psql output using csv instead of manipulating white chars or table seperators - Use strict checks for ${PGDATABASE} as there can be another database with a prefix/suffix attached - When creating/restoring a snapshot, existence of ledger_file should be optional, as there are dbsync config options that don't require lstate files, accordingly - make presence of ledger-state-file optional - When restoring a snapshot (eg: across postgres versions), there will be cases where an informational error may be expected. The presence of exit-on-error prevents use of these snapshots, especially when run from docker created by nix-ops (where it isnt as straightforward to override scripts)
That line [albeit surprisingly] does not seem to pop up a warning anymore on latest shellcheck v0.9.0-1, but added an exclusion regardless |
Interesting, I'll have to revisit next time we update nixpkgs |
Description
The postgresql-setup script (as well as docker restore functionality) seems to be only used/tested in a standard configuration and old version of postgresql. With the new options available to dbsync configuration, the setup fails over. This PR hopes to add a few minor updates that are hopefully easy to introduce as non-breaking changes and would largely assist us sticking to official images and not have to maintain a fork.
Additionally , there is a bump of references to postgresql 14 to 17 as pg14 is ancient and misses out on lot of value additions (eg: being able to add better compression on tx_cbor, parallel index maintainance without locks)
--exit-on-error
flag prevents use of these snapshots, especially when run from docker created by nix-ops (where it isnt as straightforward to override scripts)Checklist
fourmolu
on version 0.10.1.0 (which can be run withscripts/fourmolize.sh
)Migrations
If there is a breaking change, especially a big one, please add a justification here. Please elaborate
more what the migration achieves, what it cannot achieve or why a migration is not possible.