libpq port number handling - Mailing list pgsql-general

From Sam Mason
Subject libpq port number handling
Date
Msg-id 20090924195140.GG22438@samason.me.uk
Whole thread Raw
In response to Re: Newbie's question: How can I connect to my postgresql-server?  (Sam Mason <sam@samason.me.uk>)
Responses Re: [HACKERS] libpq port number handling
Re: [HACKERS] libpq port number handling
Re: [HACKERS] libpq port number handling
List pgsql-general
On Thu, Sep 24, 2009 at 07:57:55PM +0100, Sam Mason wrote:
> > postgres@sussy:/root> createuser -D -p ricky
>
> I don't think you want to be passing "-p" here; it's saying to use
> "ricky" as the port number, which fails (sounds like a bug if it doesn't
> complain about this) giving a port number of zero

Hum, why is PG doing an (unchecked) atoi on the user specified port
rather than leaving it up to getaddrinfo to resolve the port?  It would
seem to require changing UNIXSOCK_PATH to accept a string as the "port
number", which is probably a bit much of a change.

The included doesn't feel very nice, but is probably more acceptable.

--
  Sam  http://samason.me.uk/

Attachment

pgsql-general by date:

Previous
From: Rob Marjot
Date:
Subject: Re: generic modelling of data models; enforcing constraints dynamically...
Next
From: Sam Mason
Date:
Subject: Re: Newbie's question: How can I connect to my postgresql-server?