From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David Rowley <david.rowley@2ndquadrant.com>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: dblink: Replace some macros by static functions
Date: Wed, 5 Apr 2017 09:04:21 -0400
Message-ID: <d86645b3-44cb-4155-719c-66bcdeba3fe0@2ndquadrant.com> (raw)
In-Reply-To: <30881.1489435086@sss.pgh.pa.us>
References: <E1cmLoF-0005x2-GH@gemulon.postgresql.org>
<CAKJS1f9a=dyzbP3xrn7nHgEk-tNjXKybRV_csJRptzCp=hLCsA@mail.gmail.com>
<45e87bd8-6840-7249-73fa-4238a634c6c9@2ndquadrant.com>
<30881.1489435086@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
On 3/13/17 15:58, Tom Lane wrote:
> In the same vein, I think this bit in dblink_open is pretty poor coding
> practice:
>
> if (!rconn || !rconn->conn)
> dblink_conn_not_avail(conname);
> else
> conn = rconn->conn;
>
> as it expects both the compiler and the reader to understand that
> we will not proceed without "conn" getting a value. I see that
> that was band-aided around by initializing conn to NULL, but that's a
> crummy way of suppressing uninitialized-variable warnings, because it
> will mask even actual errors. Far better would be to remove the dummy
> initialization and write
>
> if (!rconn || !rconn->conn)
> dblink_conn_not_avail(conname);
> conn = rconn->conn;
fixed
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com, tgl@sss.pgh.pa.us, david.rowley@2ndquadrant.com
Subject: Re: pgsql: dblink: Replace some macros by static functions
In-Reply-To: <d86645b3-44cb-4155-719c-66bcdeba3fe0@2ndquadrant.com>
References: <E1cmLoF-0005x2-GH@gemulon.postgresql.org> <CAKJS1f9a=dyzbP3xrn7nHgEk-tNjXKybRV_csJRptzCp=hLCsA@mail.gmail.com> <45e87bd8-6840-7249-73fa-4238a634c6c9@2ndquadrant.com> <30881.1489435086@sss.pgh.pa.us> <d86645b3-44cb-4155-719c-66bcdeba3fe0@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox