Remove prepared stmnts from pgsql physical backend

Prepared statements prevent the use of connection multiplexing software
such as PGBouncer. Even when PGBouncer is configured for [session mode][1]
there's a possibility that a connection to PostgreSQL can be re-used by
different clients.  This leads to errors when clients use session based
features (like prepared statements).

This change removes prepared statements from the PostgreSQL physical
backend. This will allow vault to successfully work in infrastructures
that employ the use of PGBouncer or other connection multiplexing
software.

[1]: https://pgbouncer.github.io/config.html#poolmode
This commit is contained in:
Devin Christensen
2016-05-26 17:07:21 -06:00
parent 9c6aebf1c0
commit 3cbedeaa4d
2 changed files with 21 additions and 37 deletions

View File

@@ -32,7 +32,7 @@ func TestPostgreSQLBackend(t *testing.T) {
defer func() {
pg := b.(*PostgreSQLBackend)
_, err := pg.client.Exec("DROP TABLE " + pg.table)
_, err := pg.client.Exec("TRUNCATE TABLE " + pg.table)
if err != nil {
t.Fatalf("Failed to drop table: %v", err)
}