0

I have a PostgreSQL instance on Google Cloud SQL, and I am trying a simple COPY command to load a CSV file in a Cloud Storage bucket.

COPY shapes (key_code, pref, city)
FROM 'gs://my_bucket/data.csv'
DELIMITER ','
CSV HEADER;

When I run it in Cloud SQL Studio, I get the error:

Details: pq: permission denied to COPY from a file

I've tried looking at some tutorials, and they all say I need to locate the service account for my CloudSQL instance. The only one I can find looks like <some_id>-<another_id>@gcp-sa-cloud-sql.iam.gserviceaccount.com (In the middle of the CloudSQL instance landing page).

I've given it Storage Object Viewer on IAM and I've verified that permission on Cloud Storage.

What am I missing?

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.