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

Postgres date and time boundary conditions #2643

Merged
merged 3 commits into from
Feb 20, 2023

Conversation

JamesMcIntosh
Copy link
Contributor

This PR deals with the max and min values for dates and times in the PostgreSQL profile.

The profile currently passes through the values infinity / -infinity when you use the max/min values of the Java date/time types, this was introduced in PR #2238

This needs to be refined:

  • Postgres can only accept infinity for date and timestamp SQL types
  • LocalTime boundaries are 23:59:59.999999999 and 00:00:00, Postgres can return 24:00:00 from a time column
  • OffsetTime has the same boundaries as LocalTime with a additional ZoneOffset of +/-18:00 hours, Postgres only supports timezone boundaries of +/-15:59

https://www.postgresql.org/docs/current/datatype-datetime.html
https://docs.oracle.com/javase/8/docs/api/java/time/LocalTime.html
https://docs.oracle.com/javase/8/docs/api/java/time/OffsetTime.html

Related issues & PRs:
#2132
#2090
#1987
pgjdbc/pgjdbc#2713
#2238

Looks like there was some work which stalled which looked at Date/Time across all databases too
#2035

@github-actions
Copy link
Contributor

Incompatible changes

6 changes to com.typesafe.slick:slick since 3.5.0-pre.5.4a92f781

Code changes

Incompatibility Symbol Problem
Backward slick.jdbc.PostgresProfile$JdbcTypes$InstantJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#InstantJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$LocalDateJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#LocalDateJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$LocalDateTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#LocalDateTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$LocalTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#LocalTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$OffsetTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#OffsetTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType MissingClassProblem

interface slick.jdbc.PostgresProfile#JdbcTypes#PostgreTimeJdbcType does not have a correspondent in current version

@nafg
Copy link
Member

nafg commented Feb 1, 2023

I know it's done a lot already but relying on the confname is potentially brittle and if it were changed tests would be skipped silently.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2023

Incompatible changes

6 changes to com.typesafe.slick:slick since 3.5.0-pre.7.51172fc8

Code changes

Incompatibility Symbol Problem
Backward slick.jdbc.PostgresProfile$JdbcTypes$InstantJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#InstantJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$LocalDateJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#LocalDateJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$LocalDateTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#LocalDateTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$LocalTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#LocalTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$OffsetTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#OffsetTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType MissingClassProblem

interface slick.jdbc.PostgresProfile#JdbcTypes#PostgreTimeJdbcType does not have a correspondent in current version

@JamesMcIntosh
Copy link
Contributor Author

I know it's done a lot already but relying on the confname is potentially brittle and if it were changed tests would be skipped silently.

Hi @nafg, are you able to suggest an preferred alternative approach for isolating the tests to a specific database provider or is there a constant which I can reference?

@nafg
Copy link
Member

nafg commented Feb 10, 2023

Maybe something like tdb.profile.isInstanceOf[PostgresProfile]?

@JamesMcIntosh
Copy link
Contributor Author

Hi @nafg, I've applied the change to the tests, is there anything which needs to be done to land this PR?
Thanks James

@github-actions
Copy link
Contributor

Incompatible changes

6 changes to com.typesafe.slick:slick since 3.5.0-pre.7.51172fc8

Code changes

Incompatibility Symbol Problem
Backward slick.jdbc.PostgresProfile$JdbcTypes$InstantJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#InstantJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$LocalDateJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#LocalDateJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$LocalDateTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#LocalDateTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$LocalTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#LocalTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$OffsetTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#OffsetTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType MissingClassProblem

interface slick.jdbc.PostgresProfile#JdbcTypes#PostgreTimeJdbcType does not have a correspondent in current version

@github-actions
Copy link
Contributor

Incompatible changes

6 changes to com.typesafe.slick:slick since 3.5.0-pre.15.cec14293

Code changes

Incompatibility Symbol Problem
Backward slick.jdbc.PostgresProfile$JdbcTypes$InstantJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#InstantJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$LocalDateJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#LocalDateJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$LocalDateTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#LocalDateTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$LocalTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#LocalTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$OffsetTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#JdbcTypes#OffsetTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$JdbcTypes$PostgreTimeJdbcType MissingClassProblem

interface slick.jdbc.PostgresProfile#JdbcTypes#PostgreTimeJdbcType does not have a correspondent in current version

@github-actions
Copy link
Contributor

Incompatible changes

6 changes to com.typesafe.slick:slick since 3.5.0-pre.23.6862f90f

Code changes

Incompatibility Symbol Problem
Backward slick.jdbc.PostgresProfile$PostgresJdbcTypes$PostgreTimeJdbcType MissingClassProblem

interface slick.jdbc.PostgresProfile#PostgresJdbcTypes#PostgreTimeJdbcType does not have a correspondent in current version

Backward slick.jdbc.PostgresProfile$PostgresJdbcTypes$PostgresInstantJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#PostgresJdbcTypes#PostgresInstantJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$PostgresJdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$PostgresJdbcTypes$PostgresLocalDateJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#PostgresJdbcTypes#PostgresLocalDateJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$PostgresJdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$PostgresJdbcTypes$PostgresLocalDateTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#PostgresJdbcTypes#PostgresLocalDateTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$PostgresJdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$PostgresJdbcTypes$PostgresLocalTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#PostgresJdbcTypes#PostgresLocalTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$PostgresJdbcTypes$PostgreTimeJdbcType}

Backward slick.jdbc.PostgresProfile$PostgresJdbcTypes$PostgresOffsetTimeJdbcType MissingTypesProblem

the type hierarchy of class slick.jdbc.PostgresProfile#PostgresJdbcTypes#PostgresOffsetTimeJdbcType is different in current version. Missing types {slick.jdbc.PostgresProfile$PostgresJdbcTypes$PostgreTimeJdbcType}

@mergify mergify bot merged commit d2cd4c9 into slick:main Feb 20, 2023
@nafg
Copy link
Member

nafg commented Feb 20, 2023

@JamesMcIntosh thanks!

How should I categorize this? Is it a bug fix or an improvement? And is it significant enough to be in the Release Highlights section?

@JamesMcIntosh
Copy link
Contributor Author

Hi @nafg, thanks for getting this merged!

I would say it's a bugfix more so (even though it is also an improvement in some areas) as some of the issues which it fixes were reported as bugs.
I don't think that this would be in the highlight list.

Many thanks
James

@nafg nafg added the bug label Feb 20, 2023
@nafg nafg added this to the 3.5.0 milestone Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants