I'm trying to insert the value of an attribute of a tuple, which would be an array of date ranges, i.e. a daterange[]
, in a previous tuple accepted the value:
{"[2013-05-08,2018-03-22)"}
But now I would like to insert this array, with more than one range:
{"[19-03-2018,29-12-2020)","[21-06-2018,29-12-2020)", "[17-07-2018,29-12-2020)",
"[18-04-2018,30-07-2018]", "[01-08-2019,19-11-2019]"}
I have tried all possible solutions,putting the outer quotes
'{"[19-03-2018,29-12-2020)","[21-06-2018,29-12-2020)", "[17-07-2018,29-12-2020)",
"[18-04-2018,30-07-2018]", "[01-08-2019,19-11-2019]"}'
Putting the internal single quotes instead of the double ones, but nothing works.
Gives me the error:
argument formats can't be mixed
Best Answer
This would be legal syntax - using ISO format for dates (YYYY-MM-DD), which is always a good idea as it does not depend on the current setting of
datestyle
. Your example only works withdatestyle = 'DMY'
.You can always ask Postgres to show you:
The error msg you report does not seem to be generated by Postgres.
Are you, by any chance, using an outdated version of pgAdmin III? See: