For consistency with other libpq-based clients, py-postgresql should accept the _path to the directory_ of a unix domain socket (e.g. '/var/run/postgresql') instead of the _full path_ to the socket (e.g. '/var/run/postgresql/.s.PGSQL.5432'.) The 'port' connection parameter could be used to home in on the socket file itself (as is the behavior of the psql client.) For backwards compatibility, the full path option should probably be left in. The program could attempt to parse the 'unix' parameter as a directory path and, on failure, attempt to parse it as a full path.