Re: [COMMITTERS] pgsql: Add hash partitioning. - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [COMMITTERS] pgsql: Add hash partitioning.
Date
Msg-id CA+TgmoZ+gy=sj-=o=85FzNvy49-a3-rR2ziiaxFDuWFgMzMASg@mail.gmail.com
Whole thread Raw
Responses Re: [COMMITTERS] pgsql: Add hash partitioning.  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On Mon, Nov 13, 2017 at 3:24 AM, amul sul <sulamul@gmail.com> wrote:
> Updated patch attached -- Adjusted code comment to survive against pgindent.

That's not the right fix, or at least it's not complete.  You
shouldn't call PG_GETARG_...(n) until you've verified that
PG_ARGISNULL(n) returns false.

Also, I don't think moving the heap_open() earlier helps anything, but
you do need to replace Assert(key->partnatts == nkeys) with an
ereport() -- or just return false, but I think ereport() is probably
better.  Otherwise someone calling satisfies_hash_function() with a
wrong number of arguments for the partitioned table can cause an
assertion failure, which is bad.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: [HACKERS] pgbench: Skipping the creating primary keys afterinitialization
Next
From: Thomas Munro
Date:
Subject: Re: [HACKERS] UPDATE of partition key