Reputation: 7697
I have a Postgresql database that is running on premises which I want to import into Google Cloud SQL. My database is called test
and is owned by user test
Steps I've taken:
created database on Cloud SQL instance:
curl --header "Authorization: Bearer XXXXX" \ --header 'Content-Type: application/json' \ --data '{"project": "YYYYYY", "instance": "dev", "name": "test"}' \
https://www.googleapis.com/sql/v1beta4/projects/YYYYYY/instances/dev/databases -X POST
Created test
user:
gcloud beta sql users create test host --instance=dev --password=test
pg_dump
ERROR: must be member of role test
So how do I execute import under test
user?
Upvotes: 1
Views: 1840
Reputation: 7697
To answer my own question...
Just use --no-acl --no-owner
with pg_dump
to remove all ownership altering, and it will work.
Upvotes: 6