Skip to content

"ERROR: XX000: could not open relation with OID" when merge partitions #120

@killua001

Description

@killua001

create a partition table like Issue #117

Partition infomation:

parent partition parttype partattr range_min range_max
journal journal_5 2 dt 2017-01-01 00:20:00 2017-01-01 00:25:00
journal journal_6 2 dt 2017-01-01 00:25:00 2017-01-01 00:30:00

In session 1, merge partition #5 & #6:

[xxxx@xxx:54xx/k1 M] [08-31.16:35:17]=# begin;
BEGIN
Time: 0.221 ms
[xxxx@xxx:54xx/k1 M] [08-31.16:35:24]=# select merge_range_partitions('journal_5','journal_6');
 merge_range_partitions 
------------------------
 
(1 row)

Time: 244.467 ms

In session 2, do a select:

select count(*) from journal where dt between '2017-01-01 00:20:00' and '2017-01-01 00:30:00';

End transaction in session 1:

[xxxx@xxx:54xx/k1 M] [08-31.16:38:23]=# end;
COMMIT
Time: 39.572 ms

ERROR in session 2:

ERROR: XX000: could not open relation with OID 166068
LOCATION: relation_open, heapam.c:1066

Should lock parent table with ACCESS EXCLUSIVE mode when merge/drop partition ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions