-- Optional init script for the official postgres image (mount it in /docker-entrypoint-initdb.d/): it runs once, -- when the data directory is empty. Khaemhat creates every table itself (migrations in .NET, one database per -- company), so this only sets defaults for the application role. -- -- The role must be able to create databases (CREATEDB): the POSTGRES_USER of the official image is a superuser and -- already can; for an existing server see docs/DEPLOY.md. DO $$ BEGIN -- Timestamps are stored as timestamptz and handled in UTC by the application. EXECUTE format('ALTER ROLE %I SET timezone TO %L', current_user, 'UTC'); EXECUTE format('ALTER ROLE %I SET client_encoding TO %L', current_user, 'UTF8'); END $$;