Skip to content

date_part should support a nanosecond part #20671

Closed

Description

@mhilton

Describe the bug

Trying to use nanosecond as a part with date_part results in an error. The documentation says it should work.

To Reproduce

Call the date_part function with the part specified as 'nanosecond'. e.g: (fiddle)

SELECT date_part('nanosecond', now());

Expected behavior

The result to be the number of seconds (including any fractional part * 1_000_000_000.

Additional context

To support this date_part() will have to return an Int64, rather than an Int32 if the part is 'nanosecond'. It already has special handling for 'epoch', so I can't see this being a problem.

Activity

  1. added theissue type on Mar 3, 2026
  2. mhilton commented on Mar 3, 2026

    @mhilton
    ContributorAuthor

    take

  3. added a commit that references this issue on Mar 4, 2026
    b0349ff
  4. added a commit that references this issue on Mar 24, 2026
    50e7b86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions