Skip to content

UPDATE SET date_column = '2026-02-14' fails without explicit ::date cast via simple protocol #2333

@johannesdb

Description

@johannesdb

When using simple protocol, assigning a date string literal to a DATE column fails with:

date: unhandled type: string

Standard PostgreSQL implicitly casts string literals to the target column's type in UPDATE SET assignments.

Reproduction

CREATE TABLE test_date (id UUID PRIMARY KEY, d DATE);
INSERT INTO test_date VALUES ('00000000-0000-0000-0000-000000000001', '2026-01-01'::date);
UPDATE test_date SET d = '2026-02-14' WHERE id = '00000000-0000-0000-0000-000000000001';
-- Expected: d updated to 2026-02-14
-- Actual: "date: unhandled type: string" error

Workaround

Use explicit cast '2026-02-14'::date.

Notes

INSERT with date literals may also be affected, but we haven't tested that path since we use the same workaround everywhere.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions