Giter Site home page Giter Site logo

Test fails with "bad connection" about pq HOT 6 CLOSED

lib avatar lib commented on August 21, 2024
Test fails with "bad connection"

from pq.

Comments (6)

notedit avatar notedit commented on August 21, 2024

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

from pq.

ijt avatar ijt commented on August 21, 2024

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

from pq.

bmizerany avatar bmizerany commented on August 21, 2024

What do your Postgres logs say?

On Apr 23, 2012, at 1:57 AM, Issac [email protected] 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

from pq.

ijt avatar ijt commented on August 21, 2024

@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.

from pq.

ijt avatar ijt commented on August 21, 2024

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.

from pq.

bmizerany avatar bmizerany commented on August 21, 2024

Awesome.

On Mon, Apr 23, 2012 at 10:05 PM, Issac Trotts
[email protected]
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

from pq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.