Re: TCP/IP Sockets, UNIX Sockets - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: TCP/IP Sockets, UNIX Sockets
Date
Msg-id Pine.LNX.4.30.0106232044590.724-100000@peter.localdomain
Whole thread Raw
In response to Re: TCP/IP Sockets, UNIX Sockets  (Daniel Åkerud <zilch@home.se>)
List pgsql-general
Daniel Åkerud writes:

> What I means was, using the C API for PostgreSQL, how can I choose whether I
> want to use UNIX Sockets or regular TCP/IP Socktets? On MySQL I write either
> 127.0.0.1 for TCP/IP or "localhost" for UNIX Sockets.

Please peruse the description at
http://www.de.postgresql.org/devel-corner/docs/postgres/libpq.html#LIBPQ-CONNECT.

In particular look for the "host" parameter.  If it's empty or starts with
a slash, then it's a unix domain socket, otherwise it's TCP/IP.  (Note
that "localhost" is TCP/IP in libpq.)

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


pgsql-general by date:

Previous
From: Daniel Åkerud
Date:
Subject: Foreign Keys Constraints, perforamance analysis
Next
From: Bryan Field-Elliot
Date:
Subject: Laughable attempt at an insult from the MySQL crowd...