From d8bf7a62cd5131ba145b5eb6ccd0093770140ae6 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Wed, 17 Sep 2025 19:56:03 +0200 Subject: [PATCH] Issue #2122: support table comment syntax when creating new PostgreSQL tables --- source/table_editor.pas | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/table_editor.pas b/source/table_editor.pas index 33e16fc3..a053766f 100644 --- a/source/table_editor.pas +++ b/source/table_editor.pas @@ -953,7 +953,7 @@ begin Delete(SQL, Length(SQL)-2, 3); SQL := SQL + CRLF + ')' + CRLF; - if memoComment.Text <> '' then + if (memoComment.Text <> '') and (not DBObject.Connection.Parameters.IsAnyPostgreSQL) then SQL := SQL + 'COMMENT='+DBObject.Connection.EscapeString(memoComment.Text) + CRLF; if comboCollation.Text <> '' then SQL := SQL + 'COLLATE='+DBObject.Connection.EscapeString(comboCollation.Text) + CRLF; @@ -984,6 +984,10 @@ begin // Separate queries from here on if DBObject.Connection.Parameters.IsAnyPostgreSQL then begin + if memoComment.Text <> '' then begin + SQL := SQL + 'COMMENT ON TABLE '+DBObject.Connection.QuoteIdent(editName.Text)+ + ' IS '+DBObject.Connection.EscapeString(memoComment.Text) + ';' + sLineBreak; + end; Node := listColumns.GetFirst; while Assigned(Node) do begin Col := listColumns.GetNodeData(Node);