Skip to content

Commit

Permalink
materialize-redshift: log detected value of `enable_case_sensitive_id…
Browse files Browse the repository at this point in the history
…entifier`
  • Loading branch information
williamhbaker committed May 6, 2024
1 parent 12118e1 commit 5fbd665
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions materialize-redshift/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,21 @@ func newRedshiftDriver() *sql.Driver {
}
}

db, err := stdsql.Open("pgx", cfg.toURI())
if err != nil {
return nil, fmt.Errorf("opening db: %w", err)
}
defer db.Close()

var caseSensitiveIdentifier string
if err := db.QueryRowContext(ctx, "SHOW enable_case_sensitive_identifier;").Scan(&caseSensitiveIdentifier); err != nil {
return nil, fmt.Errorf("querying enable_case_sensitive_identifier: %w", err)
}

var caseSensitiveIdentifierEnabled = strings.EqualFold(caseSensitiveIdentifier, "on")

log.WithField("caseSensitiveIdentifierEnabled", caseSensitiveIdentifierEnabled).Info("detected value for enable_case_sensitive_identifier")

return &sql.Endpoint{
Config: cfg,
Dialect: rsDialect,
Expand Down

0 comments on commit 5fbd665

Please sign in to comment.