Skip to content

setTypeParser not applied to json_build_object values? #1743

@drulia

Description

@drulia

Not sure if this is by design, but I have noticed that values returned by json_build_object are not being processed by setTypeParser function. Even if I specify in the query of what type the value will be, it is still ignored.

Example: having this set pg.types.setTypeParser(1114, (val) => val === null ? null : moment(val));
and running same query with only difference of how values are selected will return different results.

SELECT time_column FROM test_table

time_column is instance of moment

SELECT json_build_object('time_column', time_column) FROM test_table

time_column is a string with date coming straight from database

Is this a bug or it is expected behavior?

Running 7.5.0 version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions