Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

fix: Issues when PG username is 'cloudquery' #371

Merged
merged 1 commit into from
Jun 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions database/postgres/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ func Connect(ctx context.Context, dsnURI string) (*pgxpool.Pool, error) {
return nil, dsn.RedactParseError(err)
}
poolCfg.AfterConnect = func(ctx context.Context, conn *pgx.Conn) error {
_, err := conn.Exec(ctx, "SET search_path=public")
if err != nil {
return err
}

UUIDType := pgtype.DataType{
Value: &UUID{},
Name: "uuid",
Expand Down