Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test fails with "bad connection" #19

Closed
ijt opened this issue Apr 23, 2012 · 6 comments
Closed

Test fails with "bad connection" #19

ijt opened this issue Apr 23, 2012 · 6 comments

Comments

@ijt
Copy link

ijt commented Apr 23, 2012

ijt@web:~$ PGHOST=/var/run/postgresql go test github.com/bmizerany/pq
--- FAIL: TestExec (0.06 seconds)
conn_test.go:39: driver: bad connection
--- FAIL: TestStatment (0.06 seconds)
conn_test.go:67: driver: bad connection
--- FAIL: TestRowsCloseBeforeDone (0.06 seconds)
conn_test.go:126: driver: bad connection
--- FAIL: TestEncodeDecode (0.06 seconds)
conn_test.go:168: driver: bad connection
--- FAIL: TestNoData (0.07 seconds)
conn_test.go:225: driver: bad connection
--- FAIL: TestErrorOnExec (0.06 seconds)
conn_test.go:294: expected PGError, was: &errors.errorString{s:"driver: bad connection"}
--- FAIL: TestErrorOnQuery (0.06 seconds)
conn_test.go:310: driver: bad connection
--- FAIL: TestBindError (0.06 seconds)
conn_test.go:339: driver: bad connection
--- FAIL: TestNullAfterNonNull (0.06 seconds)
conn_test.go:380: driver: bad connection
FAIL
FAIL github.com/bmizerany/pq 0.616s

Am I running this incorrectly?

@notedit
Copy link

notedit commented Apr 23, 2012

your postgresql listen on 5432? or check your database'name

@ijt
Copy link
Author

ijt commented Apr 23, 2012

My bad, I just needed to create the db.

ijt@web:$ sudo -u postgres createdb pqgotest
ijt@web:
$ PGHOST=/var/run/postgresql go test github.com/bmizerany/pq
ok github.com/bmizerany/pq 0.838s

@ijt ijt closed this as completed Apr 23, 2012
@bmizerany
Copy link
Contributor

What do your Postgres logs say?

On Apr 23, 2012, at 1:57 AM, Issac Trottsreply@reply.github.com wrote:

ijt@web:~$ PGHOST=/var/run/postgresql go test github.com/bmizerany/pq
--- FAIL: TestExec (0.06 seconds)
conn_test.go:39: driver: bad connection
--- FAIL: TestStatment (0.06 seconds)
conn_test.go:67: driver: bad connection
--- FAIL: TestRowsCloseBeforeDone (0.06 seconds)
conn_test.go:126: driver: bad connection
--- FAIL: TestEncodeDecode (0.06 seconds)
conn_test.go:168: driver: bad connection
--- FAIL: TestNoData (0.07 seconds)
conn_test.go:225: driver: bad connection
--- FAIL: TestErrorOnExec (0.06 seconds)
conn_test.go:294: expected PGError, was: &errors.errorString{s:"driver: bad connection"}
--- FAIL: TestErrorOnQuery (0.06 seconds)
conn_test.go:310: driver: bad connection
--- FAIL: TestBindError (0.06 seconds)
conn_test.go:339: driver: bad connection
--- FAIL: TestNullAfterNonNull (0.06 seconds)
conn_test.go:380: driver: bad connection
FAIL
FAIL github.com/bmizerany/pq 0.616s

Am I running this incorrectly?


Reply to this email directly or view it on GitHub:
https://github.com/bmizerany/pq/issues/19

@ijt
Copy link
Author

ijt commented Apr 24, 2012

@bmizerany Thank you for suggesting that. I am still having trouble connecting from my program, so I'll see if the log helps me track it down.

@ijt
Copy link
Author

ijt commented Apr 24, 2012

The problem was that I had not yet set a password. I set a password and set the PGPASSWORD environment variable to it, and now it connects.

@bmizerany
Copy link
Contributor

Awesome.

On Mon, Apr 23, 2012 at 10:05 PM, Issac Trotts
reply@reply.github.com
wrote:

The problem was that I had not yet set a password. I set a password and set the PGPASSWORD environment variable to it, and now it connects.


Reply to this email directly or view it on GitHub:
https://github.com/bmizerany/pq/issues/19#issuecomment-5297631

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants