Re: Fix PQport to never return NULL if the connection is valid

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix PQport to never return NULL if the connection is valid
Date: 2025-05-08 17:38:36
Message-ID: CA+mi_8awZKH_wQeP4E8tOQDPwE079bkVy92pnFx+G8B1MNeHdA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 8 May 2025 at 18:58, Daniele Varrazzo
<daniele(dot)varrazzo(at)gmail(dot)com> wrote:

> I have prepared a patch, which is attached, to fix the issue. However
> the patch returns the default port in case of no info in
> 'conn->connhost'.

Ah, of course this is wrong if the PGPORT env var is set and I assume
thanks to the pg_service...

If I understand better what to return and the strategy to return it I
can try and provide a better patch.

Cheers

-- Daniele

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2025-05-08 18:23:28 Re: Prolonged truncation phase during vacuum on toast table with repeated interruptions by lock waiters and a proposed POC patch
Previous Message Alvaro Herrera 2025-05-08 17:35:46 Re: Issue attaching a table to a partitioned table with an auto-referenced foreign key