Re: [COMMITTERS] pgsql: Add hash partitioning.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: amul sul <sulamul(at)gmail(dot)com>
Cc: Andreas Seltenreich <seltenreich(at)gmx(dot)de>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Add hash partitioning.
Date: 2017-11-13 18:59:02
Message-ID: CA+TgmoZ+gy=sj-=o=85FzNvy49-a3-rR2ziiaxFDuWFgMzMASg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Mon, Nov 13, 2017 at 3:24 AM, amul sul <sulamul(at)gmail(dot)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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2017-11-13 20:27:31 pgsql: Track in the plan the types associated with PARAM_EXEC parameter
Previous Message Alvaro Herrera 2017-11-13 18:39:10 pgsql: Mention CREATE/DROP STATISTICS in event triggers docs

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2017-11-13 20:02:45 Re: [HACKERS] UPDATE of partition key
Previous Message Fabien COELHO 2017-11-13 18:51:07 Re: [HACKERS] pgbench: Skipping the creating primary keys after initialization