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

Already on GitHub? Sign in to your account

Postgres build does not respect Makefile SCHEMA #195

Closed
tnaumann opened this Issue Apr 11, 2017 · 2 comments

Comments

Projects
None yet
2 participants
Contributor

tnaumann commented Apr 11, 2017

The top level Makefile specifies SCHEMA=mimiciii which suggests that it can be changed. However, postgres_create_tables.sql ignores this configuration and hard codes the schema.

Contributor

tnaumann commented Apr 12, 2017

One possibility for doing this might be to create a temporary schema (e.g., buildmimic) when populating the tables which could then subsequently be renamed using something like:

psql "$(DBCONN)" -c "ALTER SCHEMA buildmimic RENAME TO $(SCHEMA)"

@alistairewj alistairewj self-assigned this Apr 14, 2017

Owner

alistairewj commented Apr 14, 2017

Thanks - eventually figured out you can set the schema via the command line using the options flag:
https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-PARAMKEYWORDS (under "options"). Makefile now creates a single database connect string which includes the schema. It would be nice if you could pass those parameters to the make file rather than manually editing them but this works for now. I tested it locally and it worked - let me know if you have trouble and reopen this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment