Skip to content

Commit

Permalink
fix(PSRE-2088): error when setting owner on publication with "-"s (#17)
Browse files Browse the repository at this point in the history
It's impossible to set the owner of the publication when this one
contains dashes in the name
  • Loading branch information
achellouche authored Feb 4, 2025
2 parents fbd95e6 + 2821b30 commit 9864481
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion postgresql/resource_postgresql_publication.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func setPubOwner(txn *sql.Tx, d *schema.ResourceData) error {
n := nraw.(string)
pubName := d.Get(pubNameAttr).(string)

sql := fmt.Sprintf("ALTER PUBLICATION %s OWNER TO %s", pubName, n)
sql := fmt.Sprintf("ALTER PUBLICATION %s OWNER TO \"%s\"", pubName, n)
if _, err := txn.Exec(sql); err != nil {
return fmt.Errorf("Error updating publication owner: %w", err)
}
Expand Down

0 comments on commit 9864481

Please sign in to comment.