On Thu, Sep 17, 2015 at 9:14 AM, pinker <pin...@onet.eu> wrote:

> I've tried to write audit trigger which fires only when data changed, so I
> used "WHEN (OLD.* IS DISTINCT FROM NEW.*)" clause as described in
> documentation
> <http://www.postgresql.org/docs/9.4/static/sql-createtrigger.html>.
> Should this clause be independent from data type? because an error occurs
> when I'm trying to modify row with point data type: *ERROR: could not
> identify an equality operator for type point* Example:


Why the point (and geometric operators in general) use "=~" - w/ meaning
"same as?" - instead of (as opposed to in addition to) a regular "=" - w/
meaning "equals?" - I cannot say but because of this when IS DISTINCT tries
to locate a operator/function to use for its equality comparison it fails.
The main problem seems to be indexing and secondarily the added confusion
that introducing a new operator would cause.

It should be possible to define a new operator, "=(point, point)" with the
appropriate settings to make this work in your specific case.  Such a setup
ideally would be on the Wiki (and maybe one is...haven't looked) for others
to references.  A PGXN extension would also be a good choice for
distribution.  It doesn't seem easy or important enough to add to core.

David J.

Reply via email to