Skip to content
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

[1-dimensional-data-modeling] data loading instructions in README.md are using mismatching command and dump file types #142

Open
gitgithan opened this issue Nov 19, 2024 · 2 comments

Comments

@gitgithan
Copy link

In materials/1-dimensional-data-modeling/README.md

psql \
    -v ON_ERROR_STOP=1 \
    --username $POSTGRES_USER \
    --dbname $POSTGRES_DB \
    < /docker-entrypoint-initdb.d/data.dump>

2 problems.

  1. Extra > at end
  2. data.dump is binary tar, it only works with pg_restore, not psql. It would be unnecessary to teach users to convert binary to plaintext, so suggest removing the psql method completely and only show pg_restore.

For educational purposes, I prefer the dump to be in plaintext sql because it introduces beginners to the psql tool which is used more often than pg_restore, and lets them self-help by reading the setup SQL code without all the conversions between binary and plaintext

@mateusvasconcelos182
Copy link

Nice one!

I had to use

pg_restore
--username $POSTGRES_USER
--dbname $POSTGRES_DB
/docker-entrypoint-initdb.d/data.dump

to works, i didn't knew about it

@learner3a
Copy link

The above is giving error
--username $POSTGRES_USER
--dbname $POSTGRES_DB
/docker-entrypoint-initdb.d/data.dump
pg_restore: error: one of -d/--dbname and -f/--file must be specified
--username: command not found
--dbname: command not found
-bash: /docker-entrypoint-initdb.d/data.dump: No such file or directory

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants