"SET datestyle = ymd" in Postgres deployment every time it starts

4/4/2020

I'm working in development at this point with Skaffold.

Running into an issue where Postgres is set to ISO,MDY, but all of the dates I'm trying to import from a SQL dump are ISO,YDM. I've been manually setting it through pgAdmin with SET datastyle = ydm and the INSERT INTO works.

So I'm trying to find a way to apply the SET when the Deployment starts so it is applied every time.

My first attempt was to just add it to .sql file and have it loaded with:

# Dockerfile.dev

FROM postgres:11-alpine
EXPOSE 5432
COPY *.sql /docker-entrypoint-initdb.d/
COPY install-pgcrypto.sh /docker-entrypoint-initdb.d/

Doesn't seem to work even though the other .sql are being applied.

How should I be implementing this?

-- eox.dev
docker
kubernetes
postgresql
skaffold

0 Answers