Skip to content

Commit

Permalink
Set database name on connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
acaloiaro committed Jul 29, 2023
1 parent c237f31 commit 57c75de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backends/postgres/postgres_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (p *PgBackend) initializeDB(ctx context.Context) (err error) {
return
}

connectStr := fmt.Sprintf("postgres://%s:%s@%s", pgxCfg.User, pgxCfg.Password, pgxCfg.Host)
connectStr := fmt.Sprintf("postgres://%s:%s@%s/%s", pgxCfg.User, pgxCfg.Password, pgxCfg.Host, pgxCfg.Database)
conn, err := pgx.Connect(ctx, connectStr)
if err != nil {
p.logger.Error("unableto connect to database", err)
Expand Down

0 comments on commit 57c75de

Please sign in to comment.