[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: Unique index or primary key violation

2023-03-14 Thread Evgenij Ryazanov
Hi! It doesn't look like an original error from H2, H2 produces messages like Unique index or primary key violation: "PRIMARY_KEY_6 ON PUBLIC.AD(ACCU_ID, TARGET_ID, REPLAY_ID) VALUES ( /* key:1 */ 2, 3, 4), where 1 is an internal row number (_ROWID_) and other values are values of primary key

[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

[h2] Unique index or primary key violation

2023-03-14 Thread Ted Yu
Hi, I am facing the following error when writing to a table via hibernate: 03/11/23 19:44:52 808 ERROR SqlExceptionHelper: Unique index or primary key violation: "PRIMARY_KEY_6 ON PUBLIC.AD(ACCU_ID, TARGET_ID, REPLAY_ID) VALUES (8, 24, 1, 7)"; SQL statement: insert into ad (end_time, start_time,

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

2023-03-14 Thread Nazar Viliura
Hi, I have a task to migrate H2 db into Postgres DB and found some not constant behavior of timestamp fields when data is read. There are 2 columns, one with summer time (DST on) and on with winter time (DST off). This is how those are rendered when system's time zone is set to UTC: 2022-07-14

[h2] Contribution statement

2023-03-14 Thread Marcin Wisnicki
This statement is in relation to https://github.com/h2database/h2database/pull/3753 and any other contributions to H2 project from mwisni...@gmail.com unless otherwise stated: I wrote the code, it's mine, and I'm contributing it to H2 for distribution multiple-licensed under the MPL 2.0, and