IMMUTABLE and PARALLEL SAFE function markings

2018-11-26 Thread Gajus Kuizinas
I have defined a function "is_not_distinct" for the purpose of creating a custom operator "===". CREATE FUNCTION is_not_distinct(a anyelement, b anyelement) returns boolean language sql as $$ select a is not distinct from b; $$ IMMUTABLE; CREATE OPERATOR === ( LEFTARG = anyelement, RIGHTARG

A case for UPDATE DISTINCT attribute

2018-12-14 Thread Gajus Kuizinas
I have observed that the following pattern is repeating in our data management programs: UPDATE event SET fuid = ${fuid}, venue_id = ${venueId}, url = ${url} WHERE id = ${id} AND fuid IS != ${fuid} AND venue_id IS != ${venueId} AND url IS DISTINCT FROM ${url}; Note: "url" can be n