How big can a transaction query be?

Поиск
Список
Период
Сортировка
Искать

How big can a transaction query be?

От:
Kyle Bateman <kyle@actarg.com>
Дата:
   
Is there some limit to the size of a query or the number of independent queries that may be done
inside a transaction?

I'm doing something that looks like this:

begin;
grant select on vend to spence;
grant select on cont to spence;
grant select on privs to spence;
grant insert,select,update on cont to susan;
grant insert,select,update on cont_event to susan;
grant select,update on cont_seq to susan;
grant select on privs to susan;
grant delete,insert,select,update on po_hdr to teague;
grant delete,insert,select,update on empl to teague;
grant select,update on equ_seq to teague;
grant delete,insert,select,update on empl_event to teague;
grant select on prd_parm to teague;
grant select on prd_part to teague;
grant select,update on empl_seq to teague;
grant delete,insert,select,update on mtr_reg to teague;
grant select on prd_base to teague;
grant select on prd_vend to teague;
end; (or abort;)

But it goes on for several hundred such lines.  It works great until it gets too long and then I get:

NOTICE:  UserAbortTransactionBlock and not in in-progress state

As though it had lost track of the begin statement.  It seems to fail just as the total number of
characters in the query string passes 16K in size.  I'm using the pgtcl interface so the problem could
possibly be there as well.

Does anyone know what this limitation is and if it can be tweaked to be higher without a major
amount of hassle?  (unlimited would be nice :)

-- 
 ----------------------------------------------------
 Kyle Bateman       President, Action Target Inc.
 "Viva Yo!"         kyle@actarg.com (801)377-8033x101
 ----------------------------------------------------
 

Re: [SQL] How big can a transaction query be?

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Kyle Bateman  writes:
> As though it had lost track of the begin statement.  It seems to fail
> just as the total number of
> characters in the query string passes 16K in size.  I'm using the pgtcl
> interface so the problem could
> possibly be there as well.

It sounds like you are sending the entire thing in a single query string
and running into the limited size of the query input buffer.  Execute
the commands one at a time, or at least fewer at a time...
		regards, tom lane

FAQ