Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PostgreSQL datetime literal formats #773

Closed
6 tasks done
fulghum opened this issue Sep 27, 2024 · 0 comments · Fixed by #787
Closed
6 tasks done

Support PostgreSQL datetime literal formats #773

fulghum opened this issue Sep 27, 2024 · 0 comments · Fixed by #787

Comments

@fulghum
Copy link
Contributor

fulghum commented Sep 27, 2024

From PostgreSQL's date/time data type formatting reference:

Year-Month-Day [ Hour : Minute : Second ] [AD,BC] [ Timezone ]
YearMonthDay [ Hour : Minute : Second ] [AD,BC] [ Timezone ]
Month Day [ Hour : Minute : Second ] Year [AD,BC] [ Timezone ]
where
Year is 4013 BC, ..., very large
Month is Jan, Feb, ..., Dec or 1, 2, ..., 12
Day is 1, 2, ..., 31
Hour is 00, 02, ..., 23
Minute is 00, 01, ..., 59
Second is 00, 01, ..., 59 (60 for leap second)
Timezone is 3 characters or ISO offset to GMT

 
Date Examples:

  • Year-Month-Day – select '2024-10-31'::date;
  • Year-Month-Day – select '2024-OCT-31'::date;
  • YearMonthDay – select '20241031'::date;
  • YearMonthDay – select '2024Oct31'::date;
  • Month Day Year – select '10 31 2024'::date;
  • Month Day Year – select 'Oct 31 2024'::date;

 
Discovered while testing the Pagila data dump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant