cockroachdb / cockroachdb/cockroach

Function return-type overload versus CASE statement regression

Open
#132,792 3 comments 0 reactions 0 assignees View on GitHub
A-sql-pgcompat branch-release-23.2 branch-release-24.1 branch-release-24.2 C-bug regression T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

`select case when 0=1 then '2024-10-16 21:08:20.933859'::timestamp else current_timestamp end`

In v23.1 and in postgres v14.5, this expression works and returns a value of type `timestamp`

Starting in v23.2 and confirmed through 24.2 this returns an error:

`ERROR: incompatible value type: expected '2024-10-16 21:08:20.933859'::TIMESTAMP to be of type timestamptz, found type timestamp`

Jira issue: CRDB-43279

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.