On Sun, Feb 24, 2019 at 2:44 PM Tomas Vondra <tomas.von...@2ndquadrant.com> wrote: > On 2/24/19 10:03 AM, Alexander Korotkov wrote: > > Attached is revised version of jsonpath. Assuming that jsonpath have > > problem places, I decided to propose partial implementation. > > Following functionality was cut from jsonpath: > > 1) Support of datetime datatypes. Besides error suppression, this > > functionality have troubles with timezones. According to standard we > > should support timezones in jsonpath expressions. But that would > > prevent jsonpath functions from being immutable, that in turn limits > > their usage in expression indexes. > > Assuming we get the patch committed without the datetime stuff now, what > does that mean for the future? Does that mean we'll be unable to extend > it to support datetime in the future, or what? If we define the jsonpath > functions as immutable now, people may create indexes - which means we > won't be able to downgrade it to stable later. > > So, what's the plan here? The only thing I can think of is having two > sets of functions - an immutable one, prohibiting datetime expressions, > and stable that can't be used for indexes etc.
Reasonable question. As I understand, not datetime support itself making jsonpath functions not immutable, but implicit cast happening during comparison timestamp vs. timestamptz (and time vs. timetz). So, in future immutable functions can have limited support of datetime, where comparison of non-tz vs. tz types is restricted. And stable versions of functions (for instance, with '_tz' prefix) with full datetime support. > > 2) Suppression of numeric errors. I will post it as a separate patch. > > Pushing this even this partial implementation of jsonpath to PG 12 is > > still very useful. Also it will simplify a lot pushing other parts of > > SQL/JSON to future releases. > > > > +1 to push at least partial (but still useful) subset, instead of just > bumping the patch to PG13 Thank you for support! ------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company