Re: Allowing extensions to supply operator-/function-specific info
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Paul Ramsey <pramsey@cleverelephant.ca>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-03-05T23:26:36Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Allow extensions to generate lossy index conditions.
- 74dfe58a5927 12.0 landed
-
Build out the planner support function infrastructure.
- a391ff3c3d41 12.0 landed
-
Create the infrastructure for planner support functions.
- 1fb57af92069 12.0 landed
-
Disable transforms that replaced AT TIME ZONE with RelabelType.
- c22ecc6562aa 10.0 cited
Paul Ramsey <pramsey@cleverelephant.ca> writes:
> Thanks for the patch, I’ve applied and smoothed and taken your advice on schema-qualified lookups as well.
Hm, I think your addition of this bit is wrong:
+ /*
+ * Arguments were swapped to put the index value on the
+ * left, so we need the commutated operator for
+ * the OpExpr
+ */
+ if (swapped)
+ {
+ oproid = get_commutator(oproid);
+ if (!OidIsValid(oproid))
PG_RETURN_POINTER((Node *)NULL);
+ }
We already did the operator lookup with the argument types in the desired
order, so this is introducing an extra swap. The only reason it appears
to work, I suspect, is that all your index operators are self-commutators.
regards, tom lane