Re: PSQL error: total cell count of XXX exceeded

2023-11-21 Thread Tom Lane
Alvaro Herrera writes: > On 2023-Nov-21, Tom Lane wrote: >> Alvaro Herrera writes: >>> It's a bit annoying that the error recovery decision of this code is to >>> exit the process with an error. [...] >>> TBH though, I've never hit that code in real usage. >> Yeah, I think the reason it's staye

Re: PSQL error: total cell count of XXX exceeded

2023-11-21 Thread Alvaro Herrera
On 2023-Nov-21, Tom Lane wrote: > Alvaro Herrera writes: > > Right. I made a few more adjustments, including the additional overflow > > check in printTableInit that Tom Lane suggested, and pushed this. > > Committed patch LGTM. Thanks for looking! > > It's a bit annoying that the error recov

Re: PSQL error: total cell count of XXX exceeded

2023-11-21 Thread Tom Lane
Alvaro Herrera writes: > Right. I made a few more adjustments, including the additional overflow > check in printTableInit that Tom Lane suggested, and pushed this. Committed patch LGTM. > It's a bit annoying that the error recovery decision of this code is to > exit the process with an error.

Re: PSQL error: total cell count of XXX exceeded

2023-11-21 Thread Alvaro Herrera
On 2023-Sep-13, Hongxu Ma wrote: > After double check, looks `int64` of src/include/c.h is the proper type for > it. > Uploaded the v4 patch to fix it. Right. I made a few more adjustments, including the additional overflow check in printTableInit that Tom Lane suggested, and pushed this. It's

Re: PSQL error: total cell count of XXX exceeded

2023-11-20 Thread Tom Lane
Alvaro Herrera writes: > I think we're bound to hit this limit at some point in the future, and > it seems easy enough to solve. I propose the attached, which is pretty > much what Hongxu last submitted, with some minor changes. This bit needs more work: - content->cells = pg_malloc0((nco

Re: PSQL error: total cell count of XXX exceeded

2023-11-20 Thread Alvaro Herrera
On 2023-Sep-12, Tom Lane wrote: > 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.

Re: PSQL error: total cell count of XXX exceeded

2023-09-13 Thread Hongxu Ma
nnema ; David G. Johnston ; PostgreSQL Hackers Subject: Re: PSQL error: total cell count of XXX exceeded Michael Paquier writes: > On Tue, Sep 12, 2023 at 02:39:55AM +, Hongxu Ma wrote: > + long total_cells; > long is 4 bytes on Windows, and 8 bytes basically elsewhere. So you >

Re: PSQL error: total cell count of XXX exceeded

2023-09-12 Thread Hongxu Ma
eSQL Hackers Subject: Re: PSQL error: total cell count of XXX exceeded Michael Paquier writes: > On Tue, Sep 12, 2023 at 02:39:55AM +, Hongxu Ma wrote: > + long total_cells; > long is 4 bytes on Windows, and 8 bytes basically elsewhere. So you > would still have the sam

Re: PSQL error: total cell count of XXX exceeded

2023-09-11 Thread Tom Lane
Michael Paquier writes: > On Tue, Sep 12, 2023 at 02:39:55AM +, 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 printTab

Re: PSQL error: total cell count of XXX exceeded

2023-09-11 Thread Michael Paquier
On Tue, Sep 12, 2023 at 02:39:55AM +, Hongxu Ma wrote: > Thank you for your advice, Jelte. > I have refactored my code, please see the attached patch. (and I put > it into https://commitfest.postgresql.org/45/ for trace) { + long total_cells; long is 4 bytes on Windows, and 8 bytes bas

Re: PSQL error: total cell count of XXX exceeded

2023-09-11 Thread Hongxu Ma
. Johnston ; PostgreSQL Hackers Subject: Re: PSQL error: total cell count of XXX exceeded On Mon, 11 Sept 2023 at 08:51, Hongxu Ma wrote: > > I created a patch to fix it. > Really appreciate to anyone can help to review it. > Thanks. I think "product" as a variable name isn

Re: PSQL error: total cell count of XXX exceeded

2023-09-11 Thread Jelte Fennema
On Mon, 11 Sept 2023 at 08:51, Hongxu Ma wrote: > > I created a patch to fix it. > Really appreciate to anyone can help to review it. > Thanks. I think "product" as a variable name isn't very descriptive. Let's call it total_cells (or something similar instead). Other than that I think it's a go

Re: PSQL error: total cell count of XXX exceeded

2023-09-10 Thread Hongxu Ma
I created a patch to fix it. Really appreciate to anyone can help to review it. Thanks. From: Hongxu Ma Sent: Saturday, August 26, 2023 19:19 To: David G. Johnston Cc: PostgreSQL Hackers Subject: Re: PSQL error: total cell count of XXX exceeded Thank you David

Re: PSQL error: total cell count of XXX exceeded

2023-08-26 Thread Hongxu Ma
;s better to introduce a limit here. Or using a bigger integer type (e.g. long) for them, but it's also have the theoretical upbound. Thanks. From: David G. Johnston Sent: Saturday, August 26, 2023 12:09 To: Hongxu Ma Cc: PostgreSQL Hackers Subject: Re: PS

Re: PSQL error: total cell count of XXX exceeded

2023-08-25 Thread David G. Johnston
On Friday, August 25, 2023, Hongxu Ma wrote: > > > When I tried to select a big amount of rows, psql complains a error "Cannot > add cell to table content: total cell count of 905032704 exceeded." > > We should use long for ncolumns and nrows and give a more obvious error > message here. > > Any