Re: [PATCH] Generic type subscription

Victor Wagner <vitus@wagner.pp.ru>

From: Victor Wagner <vitus@wagner.pp.ru>
To: pgsql-hackers@postgresql.org
Date: 2016-10-04T08:28:42Z
Lists: pgsql-hackers
On Sat, 1 Oct 2016 16:52:34 +0700
Dmitry Dolgov <9erthalion6@gmail.com> wrote:

> > I've tried to compile this patch with current state of master
> > (commit 51c3e9fade76c12)  and found out that, when configured with  
> --enable-cassert,
> > it doesn't pass make check.  
> 
> Thanks for the feedback. Yes, unexpectedly for me, `ExecEvalExpr` can
> return expanded `jbvArray` and `jbvObject` instead `jbvBinary` in
> both cases. It's interesting, that this doesn't break anything, but
> obviously violates the `pushJsonbValueScalar` semantics. I don't
> think `ExecEvalExpr` should be changed for jsonb, we can handle this
> situation in `pushJsonbValue` instead. I've
> attached a new version of patch with this modification.

Thanks for you quick responce. I've not yet thoroughly investigated new
patch, but already noticed some minor promlems:

Git complains about whitespace in this version of patch:

$ git apply ../generic_type_subscription_v2.patch
../generic_type_subscription_v2.patch:218: tab in indent.
	int	first;
../generic_type_subscription_v2.patch:219: tab in indent.
	int	second;
../generic_type_subscription_v2.patch:225: tab in indent.
	SubscriptionExecData		*sbsdata = (SubscriptionExecData *) PG_GETARG_POINTER(1);
../generic_type_subscription_v2.patch:226: tab in indent.
	Custom						*result = (Custom *) sbsdata->containerSource;
../generic_type_subscription_v2.patch:234: tab in indent.
	SubscriptionRef	   *sbsref = (SubscriptionRef *) PG_GETARG_POINTER(0);
warning: squelched 29 whitespace errors
warning: 34 lines add whitespace errors.

It doesn't prevent me from further testing of patch, but worth noticing.

-- 

Victor



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. Support subscripting of arbitrary types, not only arrays.

  5. Remove obsoleted code relating to targetlist SRF evaluation.

  6. Include <sys/select.h> where needed