Skip to content

Commit 9864481

Browse files
authored
fix(PSRE-2088): error when setting owner on publication with "-"s (#17)
It's impossible to set the owner of the publication when this one contains dashes in the name
2 parents fbd95e6 + 2821b30 commit 9864481

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

postgresql/resource_postgresql_publication.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func setPubOwner(txn *sql.Tx, d *schema.ResourceData) error {
158158
n := nraw.(string)
159159
pubName := d.Get(pubNameAttr).(string)
160160

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

0 commit comments

Comments
 (0)