Re: pg_basebackup: Missing newlines in some error messages - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: pg_basebackup: Missing newlines in some error messages
Date
Msg-id 20180321125708.i3bkpdxxaarky7fi@alvherre.pgsql
Whole thread Raw
In response to Re: pg_basebackup: Missing newlines in some error messages  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
Alvaro Herrera wrote:
> Hi
> 
> Michael Banck wrote:
> 
> > I apparently managed to screw up so badly that no PQerrorMessage was
> > set, so saw the above (which indeed has no error message after the
> > colon).
> 
> Well, maybe that's a different bug, then: maybe we should print
> something other than PQerrorMessage (or maybe PQerrorMessage should not
> return empty!).  Can you reproduce the problem?

The code does look a bit weird,

    /*
     * Get the COPY data
     */
    res = PQgetResult(conn);
    if (PQresultStatus(res) != PGRES_COPY_OUT)
    {
        fprintf(stderr, _("%s: could not get COPY data stream: %s"),
                progname, PQerrorMessage(conn));

Note that noplace we check that there is actually an error.  So maybe
the conn got a result status other than COPY_OUT that's not an error ...

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pg_basebackup: Missing newlines in some error messages
Next
From: Michael Banck
Date:
Subject: Re: pg_basebackup: Missing newlines in some error messages