Skip to content

Commit 82998c3

Browse files
Use pgx escape identifier (#256)
1 parent 9966185 commit 82998c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/schema/schema.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"sort"
1010
"strings"
1111

12+
"github.com/jackc/pgx/v4"
1213
"github.com/mitchellh/hashstructure/v2"
1314
"github.com/stripe/pg-schema-diff/internal/concurrent"
1415
"github.com/stripe/pg-schema-diff/internal/queries"
@@ -1519,7 +1520,7 @@ func FQEscapedColumnName(table SchemaQualifiedName, columnName string) string {
15191520
}
15201521

15211522
func EscapeIdentifier(name string) string {
1522-
return fmt.Sprintf("\"%s\"", name)
1523+
return pgx.Identifier{name}.Sanitize()
15231524
}
15241525

15251526
// relOptionsToMap converts pg_catalog.pg_class.reloptions to a map.

0 commit comments

Comments
 (0)