From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Michael Paquier <michael@paquier.xyz>
Cc: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>
Cc: Luis Carril <luis.carril@swarm64.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Cc: PG Bug reporting form <noreply@postgresql.org>
Subject: Re: BUG #15552: Unexpected error in COPY to a foreign table in a transaction
Date: Wed, 19 Dec 2018 10:24:12 +0900
Message-ID: <734ea1ad-c44f-b802-0796-51a88303dc2c@lab.ntt.co.jp> (raw)
In-Reply-To: <20181219011904.GD2494@paquier.xyz>
References: <15552-c64aa14c5c22f63c@postgresql.org>
<8e82d10d-cc16-eed4-7634-3654f59d8053@lab.ntt.co.jp>
<LEJPR01MB00109D0BECB8A961074A7CAFE7BC0@LEJPR01MB0010.DEUPRD01.PROD.OUTLOOK.DE>
<30718b48-8020-329a-c6f0-74e1222e5283@lab.ntt.co.jp>
<5C18ECBB.2000507@lab.ntt.co.jp>
<1c23a9b1-c9c0-a11a-63fc-d821602455ba@lab.ntt.co.jp>
<20181219011904.GD2494@paquier.xyz>
On 2018/12/19 10:19, Michael Paquier wrote:
> On Wed, Dec 19, 2018 at 09:44:42AM +0900, Amit Langote wrote:
>> About adding guards in heap_sync itself to make sure that it becomes a
>> no-op for non-heap relations, I think that would make sense too.
>> Although, I wonder why it doesn't return without doing anything already,
>> given that it has this:
>>
>> heap_sync(Relation rel)
>> {
>> /* non-WAL-logged tables never need fsync */
>> if (!RelationNeedsWAL(rel))
>> return;
>
> I think that you should be careful here as we want heap_sync to remain a
> rather low-level routine. For example:
> https://www.postgresql.org/message-id/20180919214858.65bwponiuqb3rnn2@alap3.anarazel.de
I agree. Though, Andres also said this:
=====
> All the other callers of heap_sync don't care about partitioned
> tables, so we could add an assertion on RELKIND_PARTITIONED_TABLE.
Or rather, it should assert the expected relkinds?
======
which is what I was thinking. Instead of specifically preventing
partitioned tables, or foreign tables, or views, we could assert that only
relations having heap files are passed.
Thanks,
Amit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: Langote_Amit_f8@lab.ntt.co.jp, michael@paquier.xyz, fujita.etsuro@lab.ntt.co.jp, luis.carril@swarm64.com, pgsql-bugs@lists.postgresql.org, noreply@postgresql.org
Subject: Re: BUG #15552: Unexpected error in COPY to a foreign table in a transaction
In-Reply-To: <734ea1ad-c44f-b802-0796-51a88303dc2c@lab.ntt.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox