Re: [PATCH] Generic type subscripting

Artur Zakirov <a.zakirov@postgrespro.ru>

From: Arthur Zakirov <a.zakirov@postgrespro.ru>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, David Steele <david@pgmasters.net>, peter.eisentraut@2ndquadrant.com, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2017-04-05T14:33:52Z
Lists: pgsql-hackers
On 05.04.2017 16:06, Arthur Zakirov wrote:
> On 04.04.2017 15:41, Dmitry Dolgov wrote:
>> Sorry for late reply. Here is a new version of the patch, I rebased it
>> and
>> fixed those issues you've mentioned (pretty nasty problems, thank you for
>> noticing).
>
> Thank you!
>
> I've looked at the patch again.
>

Sorry maybe it's too naive. Also I was wondering.

> +	element_type_id = transformArrayType(&array_type, &array_typ_mode);
> +	sbsref->refelemtype = element_type_id;

I don't understand this part of the patch. Why is it necessary to 
execute transformArrayType() second time? It was executed in 
transformContainerSubscripts().

> +	if (!OidIsValid(elementType))
> +		elementType = containerType;

This part looks strange to me too.

It this parts are necessary it would be good to add comments.

-- 
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company


Commits

  1. Throw error when assigning jsonb scalar instead of a composite object

  2. Filling array gaps during jsonb subscripting

  3. Implementation of subscripting for jsonb

  4. Allow ALTER TYPE to update an existing type's typsubscript value.

  5. Allow subscripting of hstore values.

  6. Support subscripting of arbitrary types, not only arrays.

  7. jit: Reference function pointer types via llvmjit_types.c.

  8. Teach contain_leaked_vars that assignment SubscriptingRefs are leaky.

  9. jit: Correct parameter type for generated expression evaluation functions.

  10. Renaming for new subscripting mechanism

  11. Fix assertion failure for SSL connections.

  12. Teach eval_const_expressions() to handle some more cases.