From 8c1d0334fa7d85364043d43b7943b11b9bfc6d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Pivo=C5=88ka?= Date: Fri, 15 Aug 2025 13:32:50 +0200 Subject: [PATCH] fix(postgres): Handle case-sensitive column names --- module/postgres.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/postgres.go b/module/postgres.go index 480643c..2f37b7d 100644 --- a/module/postgres.go +++ b/module/postgres.go @@ -240,7 +240,7 @@ func (m *PostgresModule) Connect(c *sqlite3.SQLiteConn, args []string) (sqlite3. defaultValue = "" } - localColumnName := transformSQLiteValidName(columnName) + localColumnName := fmt.Sprintf(`"%s"`, transformSQLiteValidName(columnName)) if !firstRow { schema.WriteString(",\n") } @@ -250,9 +250,9 @@ func (m *PostgresModule) Connect(c *sqlite3.SQLiteConn, args []string) (sqlite3. primaryKeys = append(primaryKeys, localColumnName) } - schema.WriteString(fmt.Sprintf(" \"%s\" %s", localColumnName, columnType)) + schema.WriteString(fmt.Sprintf(" %s %s", localColumnName, columnType)) internalSchema = append(internalSchema, databaseColumn{ - Realname: columnName, + Realname: fmt.Sprintf(`"%s"`, columnName), SQLiteName: localColumnName, Type: columnType, Supported: typeSupported,