Search Postgresql Archives

Re: Shouldn't "WHEN (OLD.* IS DISTINCT FROM NEW.*)" clause be independent from data type?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 17, 2015 at 9:14 AM, pinker <pinker@xxxxxxx> 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. 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux