DDL generation is broken when a column comment contains --
Author: mariiachugunovaCreated Sep 11, 2026Updated Sep 28, 2026
Labelsxf:sqlexternal
Description
When a column comment contains --, DBeaver generates invalid table DDL. The column separator comma is placed inside the inline comment instead of before it.
DBeaver Version
CE 26.2.1ea
Operating System
Windows 11
Database and driver
No response
Steps to reproduce
- Create a test table and add column comments:
CREATE TABLE ddl_special_comment_test (
first_col text,
second_col text,
third_col text
);
COMMENT ON COLUMN ddl_special_comment_test.first_col IS
'Text with apostrophe: owner''s value';
COMMENT ON COLUMN ddl_special_comment_test.second_col IS
'Text containing -- inside the comment and "double quotes"';
COMMENT ON COLUMN ddl_special_comment_test.third_col IS
'Final column comment';- Open ddl_special_comment_test
- Open the DDL tab
- Check the generated CREATE TABLE statement
Actual result:
The generated DDL places the column separator comma inside the column comment, before the second --:
second_col text NULL -- Text containing, -- inside the comment and "double quotes"
Because everything after the first -- is treated as a comment, the comma is ignored
Expected result:
The comma should be placed before the first --, so the generated DDL is valid:
second_col text NULL, -- Text containing -- inside the comment and "double quotes"
Additional context
No response
Source: dbeaver/dbeaver