Re: [BUGS] Problem with declarative partitioning and COPY FROM - Mailing list pgsql-bugs

From Ragnar Ouchterlony
Subject Re: [BUGS] Problem with declarative partitioning and COPY FROM
Date
Msg-id 732dfc84-25f5-413c-1eee-0bfa7a370093@agama.tv
Whole thread Raw
In response to Re: [BUGS] Problem with declarative partitioning and COPY FROM  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: [BUGS] Problem with declarative partitioning and COPY FROM
List pgsql-bugs
On 2017-01-11 13:24, Amit Langote wrote:
> There's a bug and has been reported on the -hackers mailing list as
> well.  Please try your example after applying the patch 0002 attached
> with the following email:
> https://www.postgresql.org/message-id/01bc4745-bac8-a033-96a1-8a42b45d2fc1%40lab.ntt.co.jp

Ok, that is good!

I tested the patch as is, but it did not make a difference. Then I read 
the patch more carefully.

+    /*
+     * FIXME: We don't engage the bulk-insert mode for partitioned tables,
+     * because the the heap relation is most likely change from one row to
+     * next due to tuple-routing.
+     */
+    if (cstate->rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
+        bistate = GetBulkInsertState();


The if-statement does not match how I read the comment. That is, 
shouldn't it be "!=" rather than "=="?

I have tested using that change and now I get the results I expect.

/Ragnar Ouchterlony, Agama Technologies


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [BUGS] BUG #14490: psql and createdb crash with SIGSEGV
Next
From: Marcel Ruff
Date:
Subject: Re: [BUGS] BUG #14490: psql and createdb crash with SIGSEGV