Skip to content

Connection example using /var/run/postgres #30

Closed
@fergusg

Description

@fergusg

I can connect with "tcp://username:password@localhost/cdbname" but I'd rather use /var/run/postgres (unless there's another way to avoid supplying a password). However:

var pg = require('pg').native;
var client = new pg.Client("/var/run/postgres");
client.connect();

throws:

Error: Need to use node to do async DNS on host
    at /usr/local/lib/node/.npm/pg/0.4.0/package/lib/native.js:29:15
    at Connection.connect (/usr/local/lib/node/.npm/pg/0.4.0/package/lib/native.js:43:3)

Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions