Re: Fix Error Message for allocate_recordbuf() Failure - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Fix Error Message for allocate_recordbuf() Failure
Date
Msg-id CA+TgmoagYiUmz0eERRhYPuGwtjV=2zH_1M5redKdPjk++FNkPw@mail.gmail.com
Whole thread Raw
In response to Re: Fix Error Message for allocate_recordbuf() Failure  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Fix Error Message for allocate_recordbuf() Failure  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On Mon, Jul 11, 2016 at 12:04 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Sat, Jul 9, 2016 at 2:58 AM, Shoaib Lari <slari@pivotal.io> wrote:
>> Besides making the error message more informative, we had to modify
>> allocate_recordbuf() to return the actual number of bytes that were being
>> allocated.
>
> -       report_invalid_record(state, "record length %u at %X/%X too long",
> -                             total_len,
> -                             (uint32) (RecPtr >> 32), (uint32) RecPtr);
> +       report_invalid_record(state,
> +                             "cannot allocate %u bytes for record
> length %u at %X/%X",
> +                             newSizeOut, total_len, (uint32) (RecPtr >> 32),
> +                             (uint32) RecPtr);
>
> It does not look like a good idea to me to complicate the interface of
> allocate_recordbuf just to make more verbose one error message, ...

For what it's worth, I think it's fine.  Good error messages are a useful thing.

More generally, I think the whole patch looks good and should be committed.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Logical Replication WIP
Next
From: Robert Haas
Date:
Subject: Re: Odd system-column handling in postgres_fdw join pushdown patch