dbeaver icon indicating copy to clipboard operation
dbeaver copied to clipboard

[Clickhouse] Cannot import or insert/update timestamp with enabled date formatting

Open Matvey16 opened this issue 7 months ago • 2 comments

Description

Incorrect insert query is generated when date formatting is enabled. DBeaver adds trailing zeroes to the timestamp even if there none in original input. Clickhouse doesn't support that. The same error leads to inability to insert timestamp data in data import. Even if original file have a timestamp without trailing zeroes. Dbeaver will still use them in generated insert statement

DBeaver Version

25.1.0

Operating System

No response

Database and driver

ClickHouse 22.1.3.7 ClickHouse JDBC Driver 0.8.5

Steps to reproduce

  1. Enable data formatting
  2. Create a table with DateTime column
  3. Type a timestamp in appropriate format into a cell e.g. 2013-05-26 14:47:57
  4. Click generate script

Expected: UPDATE last_update='2013-05-26 14:47:57' Actual: UPDATE last_update='2013-05-26 14:47:57.000'

Additional context

Image

Image

Matvey16 avatar Jun 04 '25 16:06 Matvey16

@Matvey16, does "Use custom data/time format" helps you?

Image Image ?

Hubbitus avatar Sep 20 '25 07:09 Hubbitus

@Hubbitus This is another case. On your screenshot it is a script generated from the context menu with Generate SQL -> Insert where it does indeed work. I'm talking about the case where script is generated for changes made in data editor as well as insert in data transfer

Matvey16 avatar Oct 29 '25 08:10 Matvey16