Re: transaction limits? - Mailing list pgsql-general

From Tom Lane
Subject Re: transaction limits?
Date
Msg-id 26127.1129931637@sss.pgh.pa.us
Whole thread Raw
In response to Re: transaction limits?  (Chris Browne <cbbrowne@acm.org>)
List pgsql-general
Chris Browne <cbbrowne@acm.org> writes:
> MaXX <bs139412@skynet.be> writes:
>> An error string in the source code stands:
>> "cannot have more than 2^32-1 commands in a transaction"

> That means you couldn't do more than 2^32-1 INSERT statements.

Right.

> But that wouldn't (in principle) prevent having each of the 2^32-1 commands
> use COPY to insert 2^31 rows, which would presumably mean that the
> limit on the number of rows insertable could be 2^63-1.

In theory a single COPY command can insert an unlimited number of rows,
or anyway up till you run up against the N-terabyte table size limit.
(Its internal row counter would wrap around of course, but I'm pretty
sure that's only used for error reporting.)

The case where the CID limit would affect a COPY is if you have triggers
on the table being inserted into, and the triggers themselves perform
SQL commands --- then you'd run into the CID limit in some number of
rows depending on how many commands per trigger function.

            regards, tom lane

pgsql-general by date:

Previous
From: Chris Browne
Date:
Subject: Re: transaction limits?
Next
From: CSN
Date:
Subject: How much slower are numerics?