Re: [HACKERS] Memory allocation in spi_printtup()

2015-08-21 Thread Tom Lane
Neil Conway neil.con...@gmail.com writes: On Mon, Aug 17, 2015 at 7:56 AM, Tom Lane t...@sss.pgh.pa.us wrote: Should we back-patch this change? Seems like it's arguably a performance bug. Sounds good to me. Committed and back-patched. regards, tom lane -- Sent

Re: [HACKERS] Memory allocation in spi_printtup()

2015-08-17 Thread Tom Lane
Neil Conway neil.con...@gmail.com writes: Hi Neil! Long time no see. spi_printtup() has the following code (spi.c:1798): if (tuptable-free == 0) { tuptable-free = 256; tuptable-alloced += tuptable-free; tuptable-vals =

Re: [HACKERS] Memory allocation in spi_printtup()

2015-08-17 Thread Neil Conway
On Mon, Aug 17, 2015 at 7:56 AM, Tom Lane t...@sss.pgh.pa.us wrote: Hi Neil! Long time no see. Likewise :) Attached is a one-liner to double the size of the table when space is exhausted. I think this could use a comment, but otherwise seems OK. Attached is a revised patch with a comment.

[HACKERS] Memory allocation in spi_printtup()

2015-08-17 Thread Neil Conway
spi_printtup() has the following code (spi.c:1798): if (tuptable-free == 0) { tuptable-free = 256; tuptable-alloced += tuptable-free; tuptable-vals = (HeapTuple *) repalloc(tuptable-vals, tuptable-alloced * sizeof(HeapTuple));