Re: A bug in mapping attributes in ATExecAttachPartition()
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>, pgsql-hackers <pgsql-hackers@postgresql.org>,
Amit Langote <amitlangote09@gmail.com>
Date: 2017-08-01T17:54:42Z
Lists: pgsql-hackers
On Mon, Jul 31, 2017 at 11:10 PM, Amit Langote
<Langote_Amit_f8@lab.ntt.co.jp> wrote:
> OK, these cosmetic changes are now in attached patch 0001.
Regarding 0001:
- List *childrels;
+ List *attachRel_children;
I sorta don't see why this is necessary, or better.
/* It's safe to skip the validation scan after all */
if (skip_validate)
+ {
+ /* No need to scan the table after all. */
The existing comment should be removed along with adding the new one, I think.
- if (part_rel != attachRel &&
- part_rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
+ if (part_rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
{
- heap_close(part_rel, NoLock);
+ if (part_rel != attachRel)
+ heap_close(part_rel, NoLock);
This works out to a cosmetic change, I guess, but it makes it worse...
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Commits
-
Fix inconsistent capitalization.
- 29f021160ea7 10.0 landed
- 42651bdd68a1 11.0 landed
-
Fix bug in deciding whether to scan newly-attached partition.
- f85f88bcc270 10.0 landed
-
Fix lock upgrade hazard in ATExecAttachPartition.
- 972b6ec20bf0 10.0 landed
-
Code beautification for ATExecAttachPartition.
- 583df3b5c562 10.0 landed
-
Teach predtest.c about CHECK clauses to fix partitioning bugs.
- b08df9cab777 10.0 landed
-
Don't explicitly mark range partitioning columns NOT NULL.
- 3ec76ff1f2cf 10.0 cited