You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 19, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 19, 2026. It is now read-only.
Allow DateStyle to be "ISO, MDY", "ISO, DMY", or "ISO, YMD". #30
Hallo, I would like to change parameter datestyle from ISO, MDY to ISO, DMY in Parameter.swift
When I try:
let text = "SET DateStyle TO 'ISO, DMY';"
let cursor = try Database.connection().prepareStatement(text: text).execute()
error: Invalid value for Postgres parameter (response.name): ISO, DMY (must be ISO, MDY); closing connection
PostgresClientKit sets the Postgres DATESTYLE parameter to ISO, MDY and doesn't allow this value to be changed. This prevents misinterpretation of dates sent over the wire due to configuration mismatches.
If you want to control the format of dates in your user interface, you should use the PostgresDate type (or PostgresTimestampWithTimeZone for date/time values) and a DateFormatter (from the Foundation framework).
In my Postgres database are many funcs, where the date is set as string in format DD.MM.YYYY. ISO DMY is required. Would it be possible to set ISO DMY or MDY as a parameter please?
Activity
pitfield commentedon Nov 2, 2020
PostgresClientKit sets the Postgres
DATESTYLEparameter toISO, MDYand doesn't allow this value to be changed. This prevents misinterpretation of dates sent over the wire due to configuration mismatches.If you want to control the format of dates in your user interface, you should use the
PostgresDatetype (orPostgresTimestampWithTimeZonefor date/time values) and aDateFormatter(from the Foundation framework).AMBIENTE1 commentedon Nov 9, 2020
In my Postgres database are many funcs, where the date is set as string in format DD.MM.YYYY. ISO DMY is required. Would it be possible to set ISO DMY or MDY as a parameter please?
Allow DateStyle to be "ISO, MDY", "ISO, DMY", or "ISO, YMD".
pitfield commentedon Nov 11, 2020
Could please try this commit (tip of the develop branch)? 40fe0ff
This should allow you to set the
DATESTYLEparaameter toISO, MDY,ISO, DMY, orISO, YMD.AMBIENTE1 commentedon Nov 12, 2020
If i used playground, i couldn't use import PostgresClientKit :No such module 'PostgresClientKit'
But i modified the test and it worked properly.
Can you please add this modification to the release?
[-]change parameter[/-][+]Allow DateStyle to be "ISO, MDY", "ISO, DMY", or "ISO, YMD".[/+]pitfield commentedon Nov 13, 2020
Released in v1.3.1.
AMBIENTE1 commentedon Nov 21, 2020
thank you so much