Closed (fixed)
Project:
Drupal core
Version:
8.9.x-dev
Component:
postgresql db driver
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Mar 2020 at 22:52 UTC
Updated:
30 Nov 2020 at 15:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
xjmComment #3
chesnut commentedWe had this same issue. The problem is in the file PostgresqlDateSql.php in the core views module.
(core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php)
the TO_TIMESTAMP function in PostgreSQL 12 changed on how it processes the formats. I don't know the full details but if the incoming string has a Character that is not in the format as "Optional" it is not ignored and it throws an error.
The easy fix is to modify the format string and make "T" optional. I've tested this in PostgreSQL 9.5 and in PostgreSQL 12.x Seems to work. I tests with string of format "2017-02-10T10:08:00" and "2017-02-10 10:08:00" manually in SQL.
Line 69 should read: return "TO_TIMESTAMP($field, 'YYYY-MM-DD\"T\"HH24:MI:SS')"; instead of return "TO_TIMESTAMP($field, 'YYYY-MM-DD HH24:MI:SS')";
My colleague should post a patch file shortly.
Comment #4
catchAdding another Views date-related issue.
It would be really good to have a follow-up to move the postgres-specific logic in Views to the postgres database driver.
Comment #5
daffie commentedI agree with @catch that this belongs PostgreSQL database driver, only not in the driver directory, but as a plugin in the module part of the PostgreSQL database driver.
Comment #7
daffie commentedComment #8
alexpottComment #9
alexpottComment #10
alexpottLet's fix the unit test too...
Comment #11
krzysztof domańskiComment #12
andypostIt needs fix for 9.x too
Comment #17
catchOpened #3182793: Move PostgreSQL-specific views logic to the postgres database driver.
Committed/pushed to 9.2.x and cherry-picked back through to 8.9.x, thanks!