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

From Daniel Åkerud
Subject Re: TCP/IP Sockets, UNIX Sockets
Date
Msg-id 000101c0fbe6$4b41b0a0$c901a8c0@automatic100
Whole thread Raw
In response to Re: TCP/IP Sockets, UNIX Sockets  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: TCP/IP Sockets, UNIX Sockets  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
Well,
oops

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.

Daniel Åkerud

> Daniel Åkerud writes:
>
> > How do you force pgsql to use either TCP/IP Sockets or UNIX Sockets?
>
> This depends greatly on what exactly "pgsql" stands for.  In the server
> you can turn off the TCP/IP socket, so no client can use it.  In the
> client library you just connect() to whatever socket you want.  The
> existing clients should have a function or an option to decide.  For
> example in psql you use -h 'hostname' for TCP/IP, or -h '' for unix
> domain.
>
> > And how do you know which one it uses?
>
> You follow the documentation of the interface you use and trust it's doing
> the right thing.  When in doubt use netstat or something similar.
>
> --
> Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter
>
>


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Speed...
Next
From: Daniel Åkerud
Date:
Subject: Foreign Keys Constraints, perforamance analysis