Re: [PATCH] Avoid uninitialized-value error in poll_query_until timeout diagnostic

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Jonathan Gonzalez V(dot)" <jonathan(dot)abdiel(at)gmail(dot)com>
Cc: Bryan Green <dbryan(dot)green(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Avoid uninitialized-value error in poll_query_until timeout diagnostic
Date: 2026-08-12 04:26:46
Message-ID: anv2BnbtxT4yE9mR@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 11, 2026 at 01:32:51PM +0200, Jonathan Gonzalez V. wrote:
> What about using the most common way in the code instead of using `//`
> operator? Something like:
>
> my $msg_query = '(undef - connection attempt only)' unless defined $query;
>
> This is how is done everywhere else and is a bit more clear than the
> `//` operator which looks pretty tricky even for Perl

Using a defined() would be my go-to choice here. Using it in an if()
or an unless does not really matter.

Anyway, will fix one way or the other. Thanks for the report.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-08-12 04:42:34 Re: Fix detection of truncated zstd-compressed backups
Previous Message Tatsuya Kawata 2026-08-12 04:24:46 [PATCH] Remove unused scan tuple slots from Sort, IncrementalSort, Material and Memoize