RE: [POC] Fast COPY FROM command for the table with foreign partitions

From: "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>
To: 'Justin Pryzby' <pryzby(at)telsasoft(dot)com>
Cc: 'Zhihong Yu' <zyu(at)yugabyte(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Andrey Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>, "tanghy(dot)fnst(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(dot)com>, Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)ru>, Michael Paquier <michael(at)paquier(dot)xyz>, Ashutosh Bapat <ashutosh(dot)bapat(at)2ndquadrant(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
Subject: RE: [POC] Fast COPY FROM command for the table with foreign partitions
Date: 2021-03-05 16:54:17
Message-ID: TYAPR01MB29900C08C2C17747612A28B5FE969@TYAPR01MB2990.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
> I think this change to the regression tests is suspicous:
>
> -CONTEXT: remote SQL command: INSERT INTO public.loc2(f1, f2) VALUES
> ($1, $2)
> -COPY rem2, line 1: "-1 xyzzy"
> +CONTEXT: COPY loc2, line 1: "-1 xyzzy"
> +remote SQL command: COPY public.loc2(f1, f2) FROM STDIN
> +COPY rem2, line 2
>
> I think it shouldn't say "COPY rem2, line 2" but rather a remote version of the
> same:
> |COPY loc2, line 1: "-1 xyzzy"

No, the output is OK. The remote message is included as the first line of the CONTEXT message field. The last line of the CONTEXT field is something that was added by the local COPY command. (Anyway, useful enough information is included in the message -- the constraint violation and the data that caused it.)

> I have rebased this on my side over yesterday's libpq changes - I'll send it if
> you want, but it's probably just as easy if you do it.

I've managed to rebased it, although it took unexpectedly long. The patch is attached. It passes make check against core and postgres_fdw. I'll turn the CF status back to ready for committer shortly.

Regards
Takayuki Tsunakawa

Attachment Content-Type Size
v19-0001-Fast-COPY-FROM-into-the-foreign-or-sharded-table.patch application/octet-stream 48.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Biryukov 2021-03-05 16:55:18 Re: posgres 12 bug (partitioned table)
Previous Message Magnus Hagander 2021-03-05 16:44:20 Re: Disallow SSL compression?