Skip to content

Commit

Permalink
server/postgres: set application name and target_session_attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
dajohi committed Oct 7, 2024
1 parent 1132a6e commit f9b63cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/internal/pgdb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,8 @@ func Open(ctx context.Context, opts ...Option) (*DB, error) {
f(&o)
}

connStr := fmt.Sprintf("host=%s user=%s password=%s dbname=%s sslmode=%s",
connStr := fmt.Sprintf("host=%s user=%s password=%s dbname=%s sslmode=%s "+
"application_name=brserver target_session_attrs=primary",
o.host, o.roleName, o.passphrase, o.dbName, o.sslMode)
if !strings.HasPrefix(o.host, "/") {
connStr += fmt.Sprintf(" port=%s", o.port)
Expand Down

0 comments on commit f9b63cf

Please sign in to comment.