Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgresql-setup.sh Enhancements #1666

Open
1 of 4 tasks
rdlrt opened this issue Mar 29, 2024 · 0 comments
Open
1 of 4 tasks

postgresql-setup.sh Enhancements #1666

rdlrt opened this issue Mar 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rdlrt
Copy link

rdlrt commented Mar 29, 2024

Versions
The db-sync version (eg cardano-db-sync --version): 13.2.0.1
PostgreSQL version: 16.2

Build/Install Method
The method you use to build or install cardano-db-sync: Release binaries

Run method
The method you used to run cardano-db-sync (eg Nix/Docker/systemd/none): systemd

Additional context
The file scripts/postgresql-setup.sh is currently lagging in compatibility:

  • When using disable-ledger flag, we do not expect to have lstate files, but absence of lstate file would break the script
  • As raised in Restoring from snapshot error - role "cexplorer" does not exist #1659, when using exit-on-error flag against pg_restore, we now need to specify --no-owner and --role=<role> which wasnt required before, this role may need to be devised from PGPASSFILE (for socket, that would mean current user) OR it could be accepted as command line argument.
  • The snapshots should also contain the config to be able to easily identify compatibility for that snapshot with the flags that can be used.
  • L112 assumes psql listing of particular database can be counted by filter "${PGDATABASE} " , tho it's common to add prefix to the datbase name, would be safer to have space on either side " ${PGDATABASE} ".
count=$(psql -l "${PGDATABASE}" | grep " ${PGDATABASE} " | cut -d \| -f 3 | grep -c UTF8)
@rdlrt rdlrt added the bug Something isn't working label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant