Re: libpq debug log - Mailing list pgsql-hackers

From Tom Lane
Subject Re: libpq debug log
Date
Msg-id 3650140.1617372290@sss.pgh.pa.us
Whole thread Raw
In response to Re: libpq debug log  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: libpq debug log  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> As in the attached patch.

+1, but the comment could be more specific.  Maybe like "In regress mode,
suppress the length of ErrorResponse and NoticeResponse messages --- the F
(file name) field, in particular, can vary in length depending on compiler
used."

Actually though ... I recall now that elog.c tries to standardize the F
output by stripping the path part:

        /* keep only base name, useful especially for vpath builds */
        slash = strrchr(filename, '/');
        if (slash)
            filename = slash + 1;

I bet what is happening on drongo is that the compiler has generated a
__FILE__ value that contains backslashes not slashes, and this code
doesn't know how to shorten those.  So maybe instead of lobotomizing
this test, we should fix that.

        slash = strrchr(filename, '/');
+        if (!slash)
+            slash = strrchr(filename, '\\');
        if (slash)
            filename = slash + 1;

            regards, tom lane



pgsql-hackers by date:

Previous
From: Isaac Morland
Date:
Subject: Re: policies with security definer option for allowing inline optimization
Next
From: Bruce Momjian
Date:
Subject: Re: Refactoring HMAC in the core code