Felix Hofstätter
Felix Hofstätter

Reputation: 33

How to change datestyle in Google Cloud SQL?

I have a PostgreSQL database in gcp and I would like to change the datestyle to dd/mm/yyyy. From other answers I know that you could usually do this by changing the postgresql.config. However, I don't know how to this in google cloud.

Upvotes: 0

Views: 228

Answers (1)

Belayer
Belayer

Reputation: 14921

First off discard the notion that a date (or timestamp) has a particular format (datestyle). Internally it is a integer; the format is for conversion and display only. The trouble with editing the config file and setting the session level is you depend upon implicate conversion conversion. A better approach is to specify the the format desired thus using explicit conversion. (Yes, more typing, but more control). See fiddle.

Upvotes: 1

Related Questions