Skip to content

Commit

Permalink
Disable prepared statements when run from CLI
Browse files Browse the repository at this point in the history
Apparently, when run through a connection pooler, the prepared
statements from one run may persist to the next run because the
underlying connection is not closed and it retains the prepared
statements. This would cause the next run to fail because the prepared
statement names are deterministic and would conflict with the already
existing prepared statements.

#100
  • Loading branch information
jackc committed Aug 22, 2024
1 parent dd10d29 commit e7c7900
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,8 @@ func LoadConfig() (*Config, error) {
config.ConnConfig.RuntimeParams["application_name"] = "tern"
}

config.ConnConfig.DefaultQueryExecMode = pgx.QueryExecModeDescribeExec

return config, nil
}

Expand Down

0 comments on commit e7c7900

Please sign in to comment.