Re: BUG #15552: Unexpected error in COPY to a foreign table in atransaction - Mailing list pgsql-bugs

From Amit Langote
Subject Re: BUG #15552: Unexpected error in COPY to a foreign table in atransaction
Date
Msg-id 734ea1ad-c44f-b802-0796-51a88303dc2c@lab.ntt.co.jp
Whole thread Raw
In response to Re: BUG #15552: Unexpected error in COPY to a foreign table in atransaction  (Michael Paquier <michael@paquier.xyz>)
Responses Re: BUG #15552: Unexpected error in COPY to a foreign table in atransaction
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: Amit Langote
Date:
Subject: Re: BUG #15552: Unexpected error in COPY to a foreign table in atransaction
Next
From: Andy Edwards
Date:
Subject: Re: BUG #15558: NOTIFY max channel length is undocumented