Re: Allowing printf("%m") only where it actually works

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Allowing printf("%m") only where it actually works
Date: 2018-09-14 02:02:56
Message-ID: 20180914020256.GD29332@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 12, 2018 at 01:40:01PM -0400, Tom Lane wrote:
> Michael Paquier <michael(at)paquier(dot)xyz> writes:
> > I would have liked to look at this patch in details, but it failed to
> > apply. Could you rebase?
>
> Ah, yeah, the dlopen patch touched a couple of the same places.
> Rebase attached --- no substantive changes.

- if (handleDLL == NULL)
- ereport(FATAL,
- (errmsg_internal("could not load netmsg.dll: error
- code %lu", GetLastError())));

In 0001, this is replaced by a non-FATAL error for the backend, which
does not seem like a good idea to me because the user loses visibility
with this DDL which canot be loaded. I still have to see this error...

And about 0002. I am surprised by the amount of cleanup that the
removal of all the special wrappers for %m gives, especially
expand_fmt_string. So +1 for the concept. I have been testing both
patches individually on Windows and compilation, as well as tests, do
not show any issues. The tests have been done only with MSVC.

Could you drop the configure checks for snprintf and vsnprintf in a
separate patch? The cleanup of %m and the removal of those switches
should be treated separatly in my opinion.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-09-14 02:05:42 Re: stat() on Windows might cause error if target file is larger than 4GB
Previous Message Amit Langote 2018-09-14 01:53:05 Re: Getting ERROR: could not open file "base/13164/t3_16388" with partition table with ON COMMIT