[h2] Re: Timestamp's value is different in different time zones

2023-03-14 Thread Nazar Viliura
This is *.h2.db file( So, the issue is solved: PageStore backend cannot read persisted timestamps back properly if there is any difference between DST transition rules. Thank you very much for this and quick responses On Tuesday, March 14, 2023 at 5:18:30 PM UTC+2 Evgenij Ryazanov wrote: >

[h2] Re: Timestamp's value is different in different time zones

2023-03-14 Thread Evgenij Ryazanov
Take a look on file name extension, if it is .h2.db, this is a file from PageStore, if it is .mv.db a modern MVStore backend is used. H2 1.4.192 is too old and doesn't support JSR-310 data types yet, their initial support was added only in H2 1.4.193. If your file is in MVStore format, you can

[h2] Re: Timestamp's value is different in different time zones

2023-03-14 Thread Nazar Viliura
>From Documentation: Storage Engine for H2 For H2 version 1.4 and newer, the MVStore is the default storage engine (supporting SQL, JDBC, transactions, MVCC, and so on). For older versions, append ;MV_STORE=TRUE to the database URL. hm... should be MVStore already. Then, probably, something

[h2] Re: Timestamp's value is different in different time zones

2023-03-14 Thread Nazar Viliura
This sounds very likely as a reason! I'm using H2 v.1.4.192. How do I check if it uses PageStore backend? Also, is there any documentation which specifies this problem, if you know? Thanks in advance On Tuesday, March 14, 2023 at 11:43:18 PM UTC+9 Evgenij Ryazanov wrote: > > Unfortunately, I

[h2] Re: Timestamp's value is different in different time zones

2023-03-14 Thread Evgenij Ryazanov
> Unfortunately, I should be using an old version of jdbc driver If you use some old unsupported version of H2 with PageStore backend, you need to set the same JVM time zone as it was on system where database file was created. This backend had very problematic storage format for datetime

[h2] Re: Timestamp's value is different in different time zones

2023-03-14 Thread Nazar Viliura
thanks for a quick response! My task is a data migration and I'm working with TIMESTAMP (without time zone) field as this H2 DB was created in another system and I cannot affect this anyhow. So, as you've said, the Timestamp field should represent local date, without time zone info, so it is

[h2] Re: Timestamp's value is different in different time zones

2023-03-14 Thread Evgenij Ryazanov
Hi! There are two different timestamp data types in the SQL Standard: TIMESTAMP (TIMESTAMP WITHOUT TIME ZONE) and TIMESTAMP WITH TIME ZONE. TIMESTAMP [ WITHOUT TIME ZONE ] has YEAR, MONTH, DAY, HOUR, MINUTE, and SECOND fields. TIMESTAMP WITH TIME ZONE additionally has TIMEZONE_HOUR and