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