From: | Hongxu Ma <interma(at)outlook(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(at)paquier(dot)xyz> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: PSQL error: total cell count of XXX exceeded |
Date: | 2023-09-13 02:22:48 |
Message-ID: | TYBP286MB0351C97FB2A217D927E9C332B4F0A@TYBP286MB0351.JPNP286.PROD.OUTLOOK.COM |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Thanks for pointing that, I did miss some other "ncols * nrows" places. Uploaded v3 patch to fix them.
As for the Windows, I didn't test it before but I think it should also have the issue (and happens more possible since `cellsadded` is also a long type).
My fix idea is simple: define a common long64 type for it.
I referred MSDN: only `LONGLONG` and `LONG64` are 64 bytes. And I assume Postgres should already have a similar type, but only found `typedef long int int64` in src/include/c.h, looks it's not a proper choose.
@Michael Paquier<mailto:michael(at)paquier(dot)xyz>, could you help to give some advices here (which type should be used? or should define a new one?). Thank you very much.
________________________________
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Sent: Tuesday, September 12, 2023 12:19
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Hongxu Ma <interma(at)outlook(dot)com>; Jelte Fennema <postgres(at)jeltef(dot)nl>; David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>; PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PSQL error: total cell count of XXX exceeded
Michael Paquier <michael(at)paquier(dot)xyz> writes:
> On Tue, Sep 12, 2023 at 02:39:55AM +0000, Hongxu Ma wrote:
> + long total_cells;
> long is 4 bytes on Windows, and 8 bytes basically elsewhere. So you
> would still have the same problem on Windows, no?
More to the point: what about the multiplication in printTableInit?
The cat's been out of the bag for quite some time before we get to
printTableAddCell.
I'm more than a bit skeptical about trying to do something about this,
simply because this range of query result sizes is far past what is
practical. The OP clearly hasn't tested his patch on actually
overflowing query results, and I don't care to either.
regards, tom lane
Attachment | Content-Type | Size |
---|---|---|
v3-0001-Using-long-type-in-printTableAddCell.patch | application/octet-stream | 2.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2023-09-13 02:48:59 | Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c) |
Previous Message | Peter Smith | 2023-09-13 01:56:37 | subscription TAP test has unused $result |