dbeaver / dbeaver

Free universal database tool and SQL client
https://dbeaver.io
Apache License 2.0
38.39k stars 3.32k forks source link

(Postgres and Oracle) Advanced Copy as JSON, wrong value when copying date-like types #32664

Open J-Porras opened 1 month ago

J-Porras commented 1 month ago

Description

When inspecting the value of a record copied using the option "Advanced Copy" > "Copy as JSON" certain date types (Oracle) and timestamp (Postgres) do not represent the information stored in the database

The table is mirrored in Postgres and Oracle

DBeaver Version

Community Edition Version 24.0.4.202405051837

Operating System

Windows 10 x64

Database and driver

Database: Postgres 14.11 Driver Name and version: PostgreSQL JDBC Driver

Steps to reproduce

As an example in Postgres:

We have certain table with this row

ALTER TABLE "OSC"."REF_TERRITORIES" ADD sys_last_updated_date timestamp NULL;

The value of the cell is 2024-05-13 19:35:46.807 image

I query the table using the Dbeaver view, then I select the whole row, next I use the option "copy as JSON"

image

image

Then I paste the json in any editor and I get the wrong time image

Additional context

SSL: Use SSL ON, SSL mode: allow

E1izabeth commented 1 month ago

Please try checking this setting to disable client-side formatting. Does it help? image

J-Porras commented 1 month ago

Hello, I tried checking the option, then exporting the data to a .json and the clipboard and both options kept the wrong date times. Note: The copied time does not correspond to the local machine time image

Database value

image

Copied value

image

Destrolaric commented 1 month ago

Thanks for the report