PostgreSQL Socket


The PostgreSQL Socket back-end needs no access to the PostgreSQL C client library, since it communicates directly with the PostgreSQL server using the published frontend/backend protocol, version 2.0. This eases installation and makes it possible to dump CMU CL images containing CLSQL and this backend, contrary to backends which require FFI code.



(asdf:operate 'asdf:load-op 'clsql-postgresql-socket)

to load the PostgreSQL Socket back-end. The database type for the PostgreSQL Socket back-end is :postgresql-socket.

Connection Specification

Syntax of connection-spec

	    (host db user password &optional port options tty)

Description of connection-spec


If this is a string, it represents the hostname or IP address the PostgreSQL server resides on. In this case communication with the server proceeds via a TCP connection to the given host and port.

If this is a pathname, then it is assumed to name the directory that contains the server's Unix-Domain sockets. The full name to the socket is then constructed from this and the port number passed, and communication will proceed via a connection to this unix-domain socket.


String representing the name of the database on the server to connect to.


String representing the user name to use for authentication.


String representing the unencrypted password to use for authentication. This can be the empty string if no password is required for authentication.


Integer representing the port to use for communication with the PostgreSQL server. This defaults to 5432.


String representing further runtime options for the PostgreSQL server.


String representing the tty or file to use for debugging messages from the PostgreSQL server.