Tuesday, July 16, 2019

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

Hi Harmit,

Thank you for your help!

The pt_pt.utf8 collation is supported. You can see it on the collations list of pg_catalog on any PostgreSQL database on Cloud SQL.

As for the command you suggested, I've tried it but got an error I can't solve.

gcloud sql databases create testdb --instance=MYINSTANCE --charset=UTF8 --collation=pt_PT.utf8
ERROR: (gcloud.sql.databases.create) HTTPError 400: Invalid request: Failed to create database testdb. Detail: pq: new collation (pt_PT.utf8) is incompatible with the collation of the template database (en_US.UTF8)

The problem is that I can't change (or replace) the template1 database as the Cloud SQL postgres user is not SUPERUSER as it usually is on conventional deployments.


Thank you again!




segunda-feira, 15 de Julho de 2019 às 20:42:46 UTC+1, Harmit Rishi (Cloud Platform Support) escreveu:
Hello, 

Thank you for using Google Groups!

Would you be able to provide the documentation that indicates pt_PT.utf8 is available? Based on my research I am unable to find it on the collation support nor the character set support on PostgreSQL documentation. However, if you are certain it is supported, you can always create a database using gcloud. Your command would consist of the following flags below: 

gcloud sql databases create [DATABASE_NAME] --instance=[INSTANCE_NAME] [--charset=CHARSET] [--collation=COLLATION]

Additionally, you may find further details of how to do this here

--
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/710087ec-476e-440d-98e7-3d96cad33f37%40googlegroups.com.

No comments:

Post a Comment