Re: Re: [COMMITTERS] pgsql: Add column storage type to psql \d+ display. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: [COMMITTERS] pgsql: Add column storage type to psql \d+ display.
Date
Msg-id 9729.1216354977@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: [COMMITTERS] pgsql: Add column storage type to psql \d+ display.  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Bruce Momjian wrote:
>> I don't see that warning with my compiler so I have no way of testing
>> this, but I do see this line pretty high in the function:
>> tableinfo.relkind = *(PQgetvalue(res, 0, 1));

> But it's before the first "goto error_return", after which it is checked.

Ah.  That code is indeed broken, or at least risky in the extreme.  What
the cleanup code ought to be checking is just whether or not the arrays
have gotten allocated yet.  Checking a condition that should later lead
to the array getting allocated is just asking for trouble --- even if
there's not a "goto error_return" in between today, someday someone will
insert one.

Patch applied ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Gurjeet Singh"
Date:
Subject: Re: Load spikes on 8.1.11
Next
From: Tom Lane
Date:
Subject: Re: Load spikes on 8.1.11