| From: | Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> |
|---|---|
| To: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
| Cc: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Rintaro Ikeda <ikedarintarof(at)oss(dot)nttdata(dot)com>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, "slpmcf(at)gmail(dot)com" <slpmcf(at)gmail(dot)com>, "boekewurm+postgres(at)gmail(dot)com" <boekewurm+postgres(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com> |
| Subject: | Re: Suggestion to add --continue-client-on-abort option to pgbench |
| Date: | 2025-11-13 12:00:33 |
| Message-ID: | 20251113210033.e6d73132b3dcd17e21e1cacc@sraoss.co.jp |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, 13 Nov 2025 18:17:37 +0800
Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
>
>
> > On Nov 13, 2025, at 17:40, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> wrote:
> >
> > The following script:
> >
> > \startpipeline
> > <queries list 1>
> > \syncpipeline
> > <queries list 2>
> > \endpipeline
> >
> > can be considered equivalent to:
> >
> > BEGIN;
> > <queries list 1>
> > END;
> > BEGIN;
> > <queries list 2>
> > END;
>
> This looks like that every \sysnpipeline will start a new transaction, is that true?
Yes, it causes a new transaction to start.
In a pipeline, an implicit transaction block is started, and \syncpipeline closes it.
Then, a new implicit transaction begins.
Here’s a simple example to illustrate this:
$ cat pipeline_tx.sql
drop table if exists tbl;
create table tbl (i int);
\startpipeline
insert into tbl values(1);
insert into tbl values(2);
\syncpipeline
insert into tbl values(3);
insert into tbl values(4);
\endpipeline
$ pgbench -f pipeline_tx.sql -t 1 -M extended -n > /dev/null
$ psql -c "select xmin, i from tbl"
xmin | i
------+---
1268 | 1
1268 | 2
1269 | 3
1269 | 4
(4 rows)
Regards,
Yugo Nagata
--
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
| From | Date | Subject | |
|---|---|---|---|
| Previous Message | jian he | 2025-11-13 11:51:00 | Re: Extended Statistics set/restore/clear functions. |