@@ -115,20 +115,17 @@ func TestNewConnector(t *testing.T) {
115115 })
116116
117117 t .Run ("database=" , func (t * testing.T ) {
118- want1 , want2 := `pq: database "err" does not exist (3D000)` ,
119- `pq: database "two" does not exist (3D000)`
120- if pqtest .Pgbouncer () {
121- want1 , want2 = `pq: no such database: err (08P01)` , `pq: no such database: two (08P01)`
122- }
118+ want1 , want2 := `or:pq: database "err" does not exist (3D000)|pq: no such database: err (08P01)` ,
119+ `or:pq: database "two" does not exist (3D000)|pq: no such database: two (08P01)`
123120
124121 // Make sure database= consistently take precedence over dbname=
125122 for i := 0 ; i < 10 ; i ++ {
126123 _ , err := pqtest .DB (t , "database=err" )
127- if err == nil || err . Error () != want1 {
124+ if ! pqtest . ErrorContains ( err , want1 ) {
128125 t .Errorf ("wrong error:\n have: %s\n want: %s" , err , want1 )
129126 }
130127 _ , err = pqtest .DB (t , "dbname=one database=two" )
131- if err == nil || err . Error () != want2 {
128+ if ! pqtest . ErrorContains ( err , want2 ) {
132129 t .Errorf ("wrong error:\n have: %s\n want: %s" , err , want2 )
133130 }
134131 }
@@ -198,7 +195,7 @@ func TestRuntimeParameters(t *testing.T) {
198195 wantErr string
199196 skipPgbouncer bool
200197 }{
201- {"DOESNOTEXIST=foo" , "" , "" , " unrecognized configuration parameter" , false },
198+ {"DOESNOTEXIST=foo" , "" , "" , `or: unrecognized configuration parameter|unsupported startup parameter` , false },
202199
203200 // we can only work with a specific value for these two
204201 {"client_encoding=SQL_ASCII" , "" , "" , `unsupported client_encoding "SQL_ASCII": must be absent or "UTF8"` , false },
@@ -233,9 +230,6 @@ func TestRuntimeParameters(t *testing.T) {
233230 if tt .skipPgbouncer {
234231 pqtest .SkipPgbouncer (t )
235232 }
236- if pqtest .Pgbouncer () && tt .wantErr == "unrecognized configuration parameter" {
237- tt .wantErr = `unsupported startup parameter`
238- }
239233
240234 db , err := pqtest .DB (t , tt .conninfo )
241235 if ! pqtest .ErrorContains (err , tt .wantErr ) {
0 commit comments