Re: [HACKERS] Partitioned tables and relfilenode - Mailing list pgsql-hackers

From Amit Langote
Subject Re: [HACKERS] Partitioned tables and relfilenode
Date
Msg-id 062ab583-767d-9d08-5c7c-16b674a4c279@lab.ntt.co.jp
Whole thread Raw
In response to [HACKERS] Partitioned tables and relfilenode  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: [HACKERS] Partitioned tables and relfilenode  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Re: [HACKERS] Partitioned tables and relfilenode  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2017/04/03 11:39, Amit Langote wrote:
> On 2017/04/01 5:29, Robert Haas wrote:
>> Thanks for reviewing, and thanks to Maksim as well, and thanks to Amit
>> for writing the patch.
> 
> Thanks for committing. :)

I noticed that I had missed a couple of places that would try to scan
partitioned tables, resulting in file access.

1. In validateCheckConstraint(), along with foreign tables, must ignore
partitioned tables.

2. DefineQueryRewrite() may try to scan a partitioned table in the case of
converting a table to view, where we must make sure that the table being
converted is empty.  It's checked by scanning the heap, which we should
not do for a partitioned table.  Nor should we try to drop the storage
once ready to make the table into a REKIND_VIEW relation (because all
other checks passed okaying the conversion).

Tests are added for both the cases.

Thanks,
Amit

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

Attachment

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: [HACKERS] Function to control physical replication slot
Next
From: Alexander Korotkov
Date:
Subject: Re: [HACKERS] Merge join for GiST