Skip to content

Commit

Permalink
insert timestamp_ms & timestamp_ns into duckdb from pg working
Browse files Browse the repository at this point in the history
  • Loading branch information
destrex271 committed Jan 15, 2025
1 parent cc4a2d6 commit bc88d9c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pgduckdb_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,8 @@ GetPostgresDuckDBType(const duckdb::LogicalType &type) {
case duckdb::LogicalTypeId::DATE:
return DATEOID;
case duckdb::LogicalTypeId::TIMESTAMP:
case duckdb::LogicalTypeId::TIMESTAMP_SEC:
case duckdb::LogicalTypeId::TIMESTAMP_MS:
return TIMESTAMPOID;
case duckdb::LogicalTypeId::TIMESTAMP_TZ:
return TIMESTAMPTZOID;
Expand Down Expand Up @@ -1223,6 +1225,9 @@ ConvertPostgresToDuckValue(Oid attr_type, Datum value, duckdb::Vector &result, i
case duckdb::LogicalTypeId::DATE:
Append<duckdb::date_t>(result, duckdb::date_t(static_cast<int32_t>(value + PGDUCKDB_DUCK_DATE_OFFSET)), offset);
break;

case duckdb::LogicalTypeId::TIMESTAMP_SEC:
case duckdb::LogicalTypeId::TIMESTAMP_MS:
case duckdb::LogicalTypeId::TIMESTAMP:
Append<duckdb::timestamp_t>(
result, duckdb::timestamp_t(static_cast<int64_t>(value + PGDUCKDB_DUCK_TIMESTAMP_OFFSET)), offset);
Expand Down

0 comments on commit bc88d9c

Please sign in to comment.