- Notifications
You must be signed in to change notification settings - Fork925
chore(coderd/database/gen/dump): add optional DB_DUMP_CONNECTION_URL#16243
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
Great idea to include erro context inpanic(err)
.
- PostgreSQL 13 (optional if Docker is available) | ||
- *Note*: If you are using Docker, you can skip this step | ||
- on macOS, run `brew install postgresql@13` and `brew services start postgresql@13` | ||
- To enable schema generation with non-containerized PostgreSQL, set the following environment variable: | ||
- `export DB_DUMP_CONNECTION_URL="postgres://postgres@localhost:5432/postgres?password=postgres&sslmode=disable"` |
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.
Maybe add a warning note regardingpg_dump
version compatibility:
DB_DUMP_CONNECTION_URL='postgresql://user:pass@ds918.home:5433/coder_tmp?sslmode=disable' make genpg_dump: error: server version: 16.2 (Debian 16.2-1.pgdg120+2); pg_dump version: 13.18pg_dump: error: aborting because of server version mismatchpanic: dump schema failed: exit status 1goroutine 1 [running]:main.main() /Users/cian/src/coder/coder/coderd/database/gen/dump/main.go:70 +0x354exit status 2make: *** [Makefile:618: coderd/database/dump.sql] Error 1
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.
I think this is an unlikely scenario, you can usepg_dump@16
withpostgresql@13
but not vice-versa as you saw here. Since we're advising to use an older postgresql server here, you'd really have to make an effort to use an even olderpg_dump
😄
f27e73d
intomainUh oh!
There was an error while loading.Please reload this page.
This change allows the DB dump to be performed without Docker, BYODB.