Skip to content

TIMESTAMP is not consistently detected as TIMESTAMPTZ, when Zone information is provided. #11279

@manticore-projects

Description

@manticore-projects

What happens?

TIMESTAMP is not consistently detected as TIMESTAMPTZ, when Zone information is provided.

To Reproduce

-- surprisimgly works and returns correct result `7`
SELECT
  DATE_DIFF('HOUR',  TIMESTAMP '2010-07-07 10:20:00+07', TIMESTAMP '2010-07-07 10:20:00+00') AS hours;

-- fails: Binder Error: No function matches the given name and argument types 'date_diff(STRING_LITERAL, TIMESTAMP WITH TIME ZONE, TIMESTAMP)'
SELECT
  DATE_DIFF('HOUR',  TIMESTAMP '2010-07-07 10:20:00' AT TIME ZONE 'Asia/Bangkok', TIMESTAMP '2010-07-07 10:20:00+00') AS hours;

-- works  and returns correct result `7`
SELECT
  DATE_DIFF('HOUR',  TIMESTAMP '2010-07-07 10:20:00' AT TIME ZONE 'Asia/Bangkok', TIMESTAMPTZ '2010-07-07 10:20:00+00') AS hours;

-- technically works, but returns wrong result `0`
SELECT
  DATE_DIFF('HOUR',  TIMESTAMPTZ '2010-07-07 10:20:00' AT TIME ZONE 'Asia/Bangkok', TIMESTAMP '2010-07-07 10:20:00+00') AS hours;

OS:

Linux

DuckDB Version:

0.10.1

DuckDB Client:

Java

Full Name:

Andreas Reichel

Affiliation:

manticore-projects.com

Have you tried this on the latest nightly build?

I have tested with a release build (and could not test with a nightly build)

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • Yes, I have

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