Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-12-09 Thread Alexander Shulgin
Excerpts from Daniel Farina's message of Fri Dec 09 23:04:26 +0200 2011: > > I guess if I move the parenthetical grouping of logic around, what you > are probably intending to say is "everyone except this one ecosystem > does the normal thing, so we have an opportunity to Unite The Clans, > by ab

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-12-09 Thread Daniel Farina
On Fri, Dec 9, 2011 at 3:03 AM, Alexander Shulgin wrote: > The JDBC driver is special in that it intentionally does not use libpq.   > Given every other binding (think Ruby, Python, Perl, Tcl, etc.) does use > libpq, it makes perfect sense to me to make the syntax compatible with JDBC. I am wit

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-12-09 Thread Robert Haas
On Fri, Dec 9, 2011 at 6:03 AM, Alexander Shulgin wrote: > See above.  The hope is that URIs will be compatible sans the driver-specific > extra query parameters which might be not recognized by either party. Yeah. I am not that concerned with being stupidity-compatible with anyone else ... bu

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-12-09 Thread Alexander Shulgin
Excerpts from Daniel Farina's message of Mon Dec 05 11:56:19 +0200 2011: > > I think the current direction is fine, although as Robert Haas has > said, I am not really at all inclined to view JDBC compatibility as > any kind of a plus. JDBC URLs are weird, and do the drivers actually > link libp

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-12-05 Thread Daniel Farina
On Tue, Nov 29, 2011 at 12:02 PM, Alexander Shulgin wrote: > > Excerpts from Alexander Shulgin's message of Sat Nov 26 22:07:21 +0200 2011: >> >> So how about this: >> >>   postgresql:ssl://user:pw@host:port/dbname?sslmode=... >> >> The "postgresql:ssl://" designator would assume "sslmode=require"

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-29 Thread Alexander Shulgin
Excerpts from Alexander Shulgin's message of Sat Nov 26 22:07:21 +0200 2011: > > So how about this: > > postgresql:ssl://user:pw@host:port/dbname?sslmode=... > > The "postgresql:ssl://" designator would assume "sslmode=require", if not > overriden in extra parameters and "postgresql://" woul

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-29 Thread Alexander Shulgin
Excerpts from Alexander Shulgin's message of Sat Nov 26 21:46:32 +0200 2011: > > I would also think that if one is to specify the password in the URI, and the > password happen to contain the @-sign (e.g. "!@#$%^",) it should be > percent-encoded, like: > > postgresql://user:!%40#$%^@/ Actua

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-28 Thread Alexander Shulgin
Excerpts from Greg Smith's message of Mon Nov 28 10:08:42 +0200 2011: > > On 11/24/2011 05:21 AM, Alvaro Herrera wrote: > > A coworker also suggested using a different designator: > > > > postgresqli:///path/to/socket:5433/database > > postgresqli://:5433/database > > This is not unprecedented.

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-28 Thread Greg Smith
On 11/24/2011 05:21 AM, Alvaro Herrera wrote: A coworker also suggested using a different designator: postgresqli:///path/to/socket:5433/database postgresqli://:5433/database This is not unprecedented. An example is how CUPS handles this problem when connecting printers using URIs: http://

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-26 Thread Alexander Shulgin
Excerpts from Robert Haas's message of Thu Nov 24 13:57:17 +0200 2011: > > I think it would be really weird not to support user:pw@host:port. You can > presumably also support the JDBC style for backward compatibility, but I > don't think we should adopt that syntax as project standard. By th

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-26 Thread Alexander Shulgin
Excerpts from Robert Haas's message of Thu Nov 24 15:59:08 +0200 2011: > > I think we could do something like: > > postgresql://user:pw@host:port/database?param1=val1¶m2=val2¶m3=val3&... I wonder if this should be allowed syntax (i.e. specify a user, but connect locally, so leave 'host' to be

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-26 Thread Alexander Shulgin
Excerpts from Peter Eisentraut's message of Thu Nov 24 22:05:09 +0200 2011: > > On tor, 2011-11-24 at 15:43 +0200, Alexander Shulgin wrote: > > Huh? The service definitions are read from a local pg_service.conf, > > and are specified by setting PGSERVICE (and PGSERVICEFILE) environment > > varia

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Peter Eisentraut
On tor, 2011-11-24 at 15:43 +0200, Alexander Shulgin wrote: > Huh? The service definitions are read from a local pg_service.conf, > and are specified by setting PGSERVICE (and PGSERVICEFILE) environment > variables, no? > > What would you do with such URI if you need to other people to connect >

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Peter Eisentraut
On tor, 2011-11-24 at 09:02 -0500, Robert Haas wrote: > e.g. if we used the format suggested in my previous email, this would > just boil down to: > > postgresql:///?service=foo More correct would be postgresql:?service=foo See http://en.wikipedia.org/wiki/URI_scheme for some inspiration. --

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alexander Shulgin
Excerpts from Robert Haas's message of Thu Nov 24 17:02:13 +0200 2011: > > On Thu, Nov 24, 2011 at 9:40 AM, Alexander Shulgin > wrote: > >> Another idea is to use local:/dir/name for UNIX domain socket instead of > >> hostname:port, like it's displayed in the psql prompt. > > > > So the whole t

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Robert Haas
On Thu, Nov 24, 2011 at 9:40 AM, Alexander Shulgin wrote: >> Another idea is to use local:/dir/name for UNIX domain socket instead of >> hostname:port, like it's displayed in the psql prompt. > > So the whole thing would look like this: > >  postgresql://local:/dir/name/dbname?param1=val1&... > >

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Florian Weimer
* Alvaro Herrera: > Excerpts from Florian Weimer's message of jue nov 24 11:31:29 -0300 2011: >> >> * Alvaro Herrera: >> >> > I think we should just propose something that will not work in JDBC. >> >> I'm not sure if this is a good idea. 8-) >> >> I plan to add UNIX Domain socket support to th

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alexander Shulgin
Excerpts from Florian Weimer's message of Thu Nov 24 16:31:29 +0200 2011: > > I plan to add UNIX Domain socket support to the JDBC driver. > Eventually, the JDK will expose UNIX Domain sockets to Java code, too > (they are already used internally for management functions). Do you maybe plan to s

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alexander Shulgin
Excerpts from Robert Haas's message of Thu Nov 24 16:02:38 +0200 2011: > > > So, in that light, do we still think that letting the user specify a > > service name in the URI makes sense?  (My personal opinion is yes). > > service is just a connection parameter, so if we choose a URL format > tha

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alvaro Herrera
Excerpts from Florian Weimer's message of jue nov 24 11:31:29 -0300 2011: > > * Alvaro Herrera: > > > I think we should just propose something that will not work in JDBC. > > I'm not sure if this is a good idea. 8-) > > I plan to add UNIX Domain socket support to the JDBC driver. > Eventually,

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alexander Shulgin
Excerpts from Alexey Klyukin's message of Thu Nov 24 10:22:21 +0200 2011: > > Another idea is to use local:/dir/name for UNIX domain socket instead of > hostname:port, like it's displayed in the psql prompt. So the whole thing would look like this: postgresql://local:/dir/name/dbname?param1=

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Florian Weimer
* Alvaro Herrera: > I think we should just propose something that will not work in JDBC. I'm not sure if this is a good idea. 8-) I plan to add UNIX Domain socket support to the JDBC driver. Eventually, the JDK will expose UNIX Domain sockets to Java code, too (they are already used internally f

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Robert Haas
On Thu, Nov 24, 2011 at 8:54 AM, Alvaro Herrera wrote: > Excerpts from Martijn van Oosterhout's message of jue nov 24 04:40:42 -0300 > 2011: > >> How about the "service" option, that's a nice way of handling >> non-default socket options. > > What about it?  Are you suggesting we should support s

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alexander Shulgin
Excerpts from Robert Haas's message of Thu Nov 24 15:59:08 +0200 2011: > > Well, based on that document, I think that trying to be bug-compatible > with the JDBC syntax is a, erm, doomed effort. I mean, what are you > going to do with things like loglevel or logUnclosedConnections that > change

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alvaro Herrera
Excerpts from Alvaro Herrera's message of jue nov 24 10:21:49 -0300 2011: > A coworker also suggested using a different designator: > > postgresqli:///path/to/socket:5433/database > postgresqli://:5433/database I forgot to mention: this "i" thing comes from LDAP. Apparently you can use "ldapi:

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Robert Haas
On Thu, Nov 24, 2011 at 8:50 AM, Alexander Shulgin wrote: > What JDBC supports is rather weird and far from being ideal: > http://jdbc.postgresql.org/documentation/head/connect.html > > The problem with supporting multiple syntaxes, IMO is that it makes libpq > compatible in only one direction:

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alvaro Herrera
Excerpts from Martijn van Oosterhout's message of jue nov 24 04:40:42 -0300 2011: > How about the "service" option, that's a nice way of handling > non-default socket options. What about it? Are you suggesting we should support some way to specify a service name in the URI? If so, consider th

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alvaro Herrera
Excerpts from Robert Haas's message of jue nov 24 10:35:36 -0300 2011: > On Thu, Nov 24, 2011 at 7:33 AM, Alexander Shulgin > wrote: > > > > Excerpts from Robert Haas's message of Thu Nov 24 13:57:17 +0200 2011: > >> > >> I think it would be really weird not to support user:pw@host:port.  You >

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alexander Shulgin
Excerpts from Robert Haas's message of Thu Nov 24 15:35:36 +0200 2011: > > > Do you suggest that we should reconsider? > > I guess my feeling is that if we're going to have URLs, we ought to > try to adhere to the same conventions that are used for pretty much > every other service that supports

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alexander Shulgin
Excerpts from Alvaro Herrera's message of Thu Nov 24 15:21:49 +0200 2011: > > I think the question is allowing the URI to specify a service. Huh? The service definitions are read from a local pg_service.conf, and are specified by setting PGSERVICE (and PGSERVICEFILE) environment variables, no?

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Robert Haas
On Thu, Nov 24, 2011 at 7:33 AM, Alexander Shulgin wrote: > > Excerpts from Robert Haas's message of Thu Nov 24 13:57:17 +0200 2011: >> >> I think it would be really weird not to support user:pw@host:port.  You can >> presumably also support the JDBC style for backward compatibility, but I >> do

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alvaro Herrera
Excerpts from Alexander Shulgin's message of jue nov 24 05:58:57 -0300 2011: > Excerpts from Martijn van Oosterhout's message of Thu Nov 24 09:40:42 +0200 > 2011: > > Which does raise the valid question of how to represent that in URI > > syntax. SQLAlchemy (for example) doesn't try with it's U

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alexander Shulgin
Excerpts from Robert Haas's message of Thu Nov 24 13:57:17 +0200 2011: > > I think it would be really weird not to support user:pw@host:port. You can > presumably also support the JDBC style for backward compatibility, but I > don't think we should adopt that syntax as project standard. Well,

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Robert Haas
On Nov 24, 2011, at 1:57 AM, Alexander Shulgin wrote: > While it is really tempting to provide support for all that fancy stuff (or > at least support "user:password@host" part instead of the ugly > "?user=&password=") this will make psql URIs backward-incompatible with the > JDBC syntax, which

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alexander Shulgin
Excerpts from Martijn van Oosterhout's message of Thu Nov 24 09:40:42 +0200 2011: > On Thu, Nov 24, 2011 at 08:59:56AM +0200, Alexander Shulgin wrote: > > > How would you specifiy a local port/UNIX domain socket? > > > > Missed that in my previous reply. > > > > If host part of the URI points t

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-24 Thread Alexey Klyukin
On Nov 24, 2011, at 9:40 AM, Martijn van Oosterhout wrote: > On Thu, Nov 24, 2011 at 08:59:56AM +0200, Alexander Shulgin wrote: >>> How would you specifiy a local port/UNIX domain socket? >> >> Missed that in my previous reply. >> >> If host part of the URI points to localhost, the UNIX domain

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-23 Thread Dmitriy Igrishin
2011/11/24 Alexander Shulgin > > Excerpts from Dmitriy Igrishin's message of Thu Nov 24 09:19:02 +0200 2011: > > > > > If host part of the URI points to localhost, the UNIX domain socket > would > > > be considered by libpq just as if you would pass "-h localhost -p > 5433". > > > > > But what if

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-23 Thread Martijn van Oosterhout
On Thu, Nov 24, 2011 at 08:59:56AM +0200, Alexander Shulgin wrote: > > How would you specifiy a local port/UNIX domain socket? > > Missed that in my previous reply. > > If host part of the URI points to localhost, the UNIX domain socket would be > considered by libpq just as if you would pass "-

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-23 Thread Alexander Shulgin
Excerpts from Dmitriy Igrishin's message of Thu Nov 24 09:19:02 +0200 2011: > > > If host part of the URI points to localhost, the UNIX domain socket would > > be considered by libpq just as if you would pass "-h localhost -p 5433". > > > But what if the user wants to connect exactly via socket o

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-23 Thread Dmitriy Igrishin
Hey Alexander, 2011/11/24 Alexander Shulgin > > Excerpts from Florian Weimer's message of Wed Nov 23 13:04:47 +0200 2011: > > > > * Alexander Shulgin: > > > > > This, in my opinion, is very similar to what we would like to achieve > with the URI syntax, so the above could also be specified using

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-23 Thread Alexander Shulgin
Excerpts from Florian Weimer's message of Wed Nov 23 13:04:47 +0200 2011: > > * Alexander Shulgin: > > > This, in my opinion, is very similar to what we would like to achieve with > > the URI syntax, so the above could also be specified using a URI parameter > > like this: > > > > psql -d po

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-23 Thread Alexander Shulgin
Excerpts from Florian Weimer's message of Wed Nov 23 13:04:47 +0200 2011: > > * Alexander Shulgin: > > > This, in my opinion, is very similar to what we would like to achieve with > > the URI syntax, so the above could also be specified using a URI parameter > > like this: > > > > psql -d po

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-23 Thread Florian Weimer
* Alexander Shulgin: > This, in my opinion, is very similar to what we would like to achieve with > the URI syntax, so the above could also be specified using a URI parameter > like this: > > psql -d postgresql://example.net:5433/mydb How would you specifiy a local port/UNIX domain socket? W

Re: [HACKERS] Notes on implementing URI syntax for libpq

2011-11-23 Thread Michael Meskes
> It was proposed a while ago for libpq to support URI syntax for specifying > the connection information: > ... > Now we're going to actually implement this. Do you know that we had this feature (more or less) in libpq for years but it was removed quite a while ago. It should still be there in t

[HACKERS] Notes on implementing URI syntax for libpq

2011-11-21 Thread Alexander Shulgin
Hello, It was proposed a while ago for libpq to support URI syntax for specifying the connection information: http://archives.postgresql.org/message-id/1302114698.23164.17.camel@jd-desktop http://archives.postgresql.org/pgsql-hackers/2011-07/msg01144.php It appears to me that the consensus