libpq port number handling

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: libpq port number handling
Date: 2009-09-24 19:51:40
Message-ID: 20090924195140.GG22438@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Thu, Sep 24, 2009 at 07:57:55PM +0100, Sam Mason wrote:
> > postgres(at)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 Content-Type Size
pgsql-8.4-socketnum.patch text/x-diff 604 bytes

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2009-09-24 19:59:44 Re: Newbie's question: How can I connect to my postgresql-server?
Previous Message Ricky Tompu Breaky 2009-09-24 19:47:23 Re: Newbie's question: How can I connect to my postgresql-server?

Browse pgsql-hackers by date

  From Date Subject
Next Message Sam Mason 2009-09-24 19:59:44 Re: Newbie's question: How can I connect to my postgresql-server?
Previous Message Ricky Tompu Breaky 2009-09-24 19:47:23 Re: Newbie's question: How can I connect to my postgresql-server?