In order to load a MS Access mdb file into PostgreSQL, I type the following command on the psql command line.
mdb-schema xxx.mdb postgres | psql -h xxx -U xxx -W -d xxx
However, the Postgres tables are made under the default public schema. I want to have them under a different schema ("network"), rather than the default schema("public"). Could you please tell me how to change from "public" to "network" in this situation?
I appreciate any suggestions.
You need to set PGOPTIONS:
mdb-schema xxx.mdb postgres | PGOPTIONS='-c search_path=network' psql -h xxx -U xxx -W -d xxx
and here is the proof (set schema to test_schema):
$ PGOPTIONS='-c search_path=test_schema' psql postgres -c 'show search_path'
search_path
-------------
test_schema
(1 row)
Using PGOPTIONS
you can set (almost) any configuration directive
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With