Re: transaction limits?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chris Browne <cbbrowne(at)acm(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: transaction limits?
Date: 2005-10-21 21:53:57
Message-ID: 26127.1129931637@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Chris Browne <cbbrowne(at)acm(dot)org> writes:
> MaXX <bs139412(at)skynet(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message CSN 2005-10-21 22:30:15 How much slower are numerics?
Previous Message Chris Browne 2005-10-21 20:49:01 Re: transaction limits?