[drupal-devel] [bug] PostgreSQL Socket Connection
Steven
drupal-devel at drupal.org
Mon Jul 25 17:33:00 UTC 2005
Issue status update for
http://drupal.org/node/26836
Post a follow up:
http://drupal.org/project/comments/add/26836
Project: Drupal
Version: 4.6.2
Component: postgresql database
Category: bug reports
Priority: normal
Assigned to: Anonymous
Reported by: iamtheari
Updated by: Steven
Status: patch
Are Unix sockets something that is standard supported and enabled for
PGSQL? If not, it is confusing to change the behaviour just because you
enter "localhost" with no port. Why not make a special reserved hostname
(e.g. 'unixsocket') for this? It can be documented easily in
settings.php.
Steven
Previous comments:
------------------------------------------------------------------------
Sat, 16 Jul 2005 16:52:16 +0000 : iamtheari
Attachment: http://drupal.org/files/issues/drupal-pgsql-socket.patch (917 bytes)
Drupal does not allow for PostgreSQL connections via unix socket. I
have written a patch that allows it to do so. The effect of this patch
is that a hostname of 'localhost' in a pgsql:// $db_url will use Unix
sockets unless a port it set in the URL. A hostname of '127.0.0.1'
will use TCP/IP as before.
Examples:
Unix socket: pgsql://user:pass@localhost/db
TCP/IP: pgsql://user:pass@localhost:4444/db
TCP/IP: pgsql://user:pass@127.0.0.1/db
TCP/IP: pgsql://user:pass@127.0.0.1:4444/db
The patch is attached to this bug report. From a top-level Drupal
directory, type 'patch -p0 < /path/to/drupal-pgsql-socket.patch' to
apply it (omit the single-quotes).
------------------------------------------------------------------------
Sat, 16 Jul 2005 17:08:09 +0000 : chx
First, welcome among contributors and thanks for the patch, it looks
useful. There are a few general problems: only bugfixes go into 4.6.x
everything else, like this should be for HEAD. Other problem is with
coding style, we use
<?php
if () {
}
else {
}
?>
also you spacing issues, like spaces are a dot. The rule, as explained
to me by Steven is that there is never a space between a dot and a
quote always otherwise. There is also coding style guideline in CVS.
------------------------------------------------------------------------
Sun, 17 Jul 2005 05:06:39 +0000 : iamtheari
I don't run the CVS version, but somehow I doubt that the file in
question has changed significantly enough to prevent the patch from
working. As to the coding style, see now that Drupal's guidelines
require the space between "if" and "(", but the extra spaces around the
dots was from the original code in the patched file, as you can see from
the lines of the patch beginning with a "-". Regardless, I hope that my
code can be hammered into shape so as to fit into Drupal.
Just be sure to warn people that the behavior of
'pgsql://user:password@localhost/db' has changed, if this makes it in.
More information about the drupal-devel
mailing list