Azure / azure-postgresql

Azure Database for PostgreSQL (fully managed service for PostgreSQL in Azure)
MIT License
78 stars 78 forks source link

pg_restore dbname is missing in command call #69

Open ramirezaa opened 4 years ago

ramirezaa commented 4 years ago

When applying the pg_restore command, I kept getting an issue stating that the database name was not set. It seems that the following command was not doing anything:

export PGDATABASE=$TARGET_DATABASE_NAME

I updated the pg_restore call to the following which ended up fixing the issue:

pg_restore -v --no-owner --host="$TARGET_SERVER_NAME.postgres.database.azure.com" --port=5432 --username="$TARGET_USERNAME@$TARGET_SERVER_NAME" --dbname=$TARGET_DATABASE_NAME "$SOURCE_DATABASE_NAME.dump"

Is there any reason as to why this issue would come up?

miyamam commented 3 years ago

Thank you for pointing this issue. I could restore it. But warning errors ignored on restore was 223. That was huge.