Git Product home page Git Product logo

Comments (4)

 avatar commented on August 25, 2024

You could use the default socket location for the postgres unix socket, if you don't specify a host at all.

@ryandotsmith What do you think of changing the way, queue_classic specifies its database settings, so that unix socket locations can also be specified?
Maybe with query strings, like postgres://var/run/postgresql.sock?user=foo&pw=bar&db=mydb
I could send a pull request, if you don't mind adding this to queue_classic.

URI.parse already parses the path and the query string, we would only have to parse the a=b&c=d.. stuff.

The pg driver supports, specifying the socket location as the hostname, but URI.parse does not allow, e.g. postgres://user@/var/run/xy.sock/mydb

Therefore I think, another syntax for unix socket connections would be ok, wouldn't it?

from queue_classic.

 avatar commented on August 25, 2024

@ryandotsmith Would you accept a pull request which makes queue_classic accept unix socket paths in querystring format too, like "postgres://var/run/postgresql.sock?user=foo&pw=bar&db=mydb" ?
(Additionally to the classic URI style..)

from queue_classic.

ryandotsmith avatar ryandotsmith commented on August 25, 2024

@ClemensGruber that would be great!

from queue_classic.

jperville avatar jperville commented on August 25, 2024

After searching mailing lists, I discovered that recent versions of `libpq' should connect to hosts that are actually percent-encoded socket paths. The feature is only documented for PostgreSQL 9.2 and onwards.

In other words, the following kind of database urls should be supported:

postgresql://%2Fvar%2Flib%2Fpostgresql/dbname

Reference: search the "percent" string in http://www.postgresql.org/docs/9.2/interactive/libpq-connect.html

I am now preparing a pull request to fix this issue by adding support for percent-encoded socket paths in DATABASE_URL.

from queue_classic.

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.