Tuesday, July 16, 2019

[google-cloud-sql-discuss] Re: Create a Postgres database with a collation other than en_us.utf8

Hello Pedro, 

After some trial and error, I was able to get to intended behavior by preforming the query within the instance by SSH. Here is how I was able to do it: 

1. Google Cloud Platform Console > SQL
2. Create PostgreSQL instance 
3. Open instance details > Connect to this instance : Connect using Cloud Shell
4. Enter instance credentials
5. RunCREATE DATABASE "example_db" WITH OWNER "postgres" ENCODING 'UTF8' LC_COLLATE = 'pt_PT.UTF-8' LC_CTYPE = 'pt_PT.UTF-8' TEMPLATE template0;
6.  pt_PT.utf8 will be created and you will be able to see it in GCP console> SQL: Databases 

If you would like more details about the query provided, you may refer to the following StackOverflow discussion here. As for the 
SUPERUSER attributes, you may see the following documentation that discusses the cloudsqlsuperuser role as SUPERUSER is not available within Cloud SQL due to it being Google-managed.

I hope this helps!

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/1ab877e8-aa04-40e2-a5fa-973550672800%40googlegroups.com.

No comments:

Post a Comment