Skip to content

interval cast has some problematic behaviour #11271

@samuelcolvin

Description

@samuelcolvin

Describe the bug

There's a few issues with casting to an interval.

Specifically:

  • '1'::interval -> 0 years 1 mons 0 days 0 hours 0 mins 0.000000000 secs - postgres returns 1s, I think other databases do the same - this is the worst offender IMHO
  • '1s'::interval gives an error, with postgres it returns 1s
  • '1second'::interval gives an error, with postgres it returns 1s

Happy to try to fix this if there's willingness? In particular, I think '1'::interval should be fixed asap.

To Reproduce

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions