[PATCH] Generic type subscription - Mailing list pgsql-hackers

From Dmitry Dolgov
Subject [PATCH] Generic type subscription
Date
Msg-id CA+q6zcVDuGBv=M0FqBYX8DPebS3F_0KQ6OVFobGJPM507_SZ_w@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] Generic type subscription
Re: [PATCH] Generic type subscription
List pgsql-hackers
Hi,

Regarding to the previous conversations [1], [2], here is a patch (with some
improvements from Nikita Glukhov) for the generic type subscription. It allows
to define type-specific subscription logic for any data type and has
implementations for the array and jsonb types. There are following changes in this
patch:

* A new column for `pg_type` (`regproc typsubscription`) which points out a
  type-specific subscription procedure for particular data type. It can be none
  (and it's a default value), which means that this data type doesn't support
  subscription.

* Type-specific code (e.g. any kind of verification, type coercion, actual
  data extraction and update) in the array subscription implementation was
  separated from generic code into `array_subscription` procedure. Generic
  implementation assumes that subscription expression can be in form `[a]` or
  `[a:b]`, and there isn't any restrictions for type of `a` and `b`.

* Using the same api a new subscription logic was implemented for `jsonb` type
  in `jsonb_subscription` procedure. Several changes were introduced into jsonb
  functions just to be able to share common code.

I believe that this patch is more or less in good shape, so I would like to know
what do you think about it? Feedback is welcome.

Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Tuplesort merge pre-reading
Next
From: Tom Lane
Date:
Subject: Re: Re: GiST optimizing memmoves in gistplacetopage for fixed-size updates [PoC]