File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
rust/cubesql/pg-srv/src/values Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,14 @@ impl FromProtocolValue for TimestampValue {
158158 . or_else ( |_| NaiveDateTime :: parse_from_str ( as_str, "%Y-%m-%d %H:%M:%S%.f" ) )
159159 . or_else ( |_| NaiveDateTime :: parse_from_str ( as_str, "%Y-%m-%dT%H:%M:%S" ) )
160160 . or_else ( |_| NaiveDateTime :: parse_from_str ( as_str, "%Y-%m-%dT%H:%M:%S%.f" ) )
161+ // PostgreSQL supports more formats aligned with parse_date_str
162+ . or_else ( |_| NaiveDateTime :: parse_from_str ( as_str, "%Y-%m-%dT%H:%M:%S%.fZ" ) )
163+ . or_else ( |_| {
164+ NaiveDate :: parse_from_str ( as_str, "%Y-%m-%d" ) . map ( |date| {
165+ date. and_hms_opt ( 0 , 0 , 0 )
166+ . expect ( "Unable to set time to 00:00:00" )
167+ } )
168+ } )
161169 . map_err ( |err| ProtocolError :: ErrorResponse {
162170 source : ErrorResponse :: error (
163171 ErrorCode :: ProtocolViolation ,
You can’t perform that action at this time.
0 commit comments