I have installed the intarray extension installed in the public schema and am 
attempting to  use this in a plpgsql trigger function from another schema.
When the triggers executes this I get an exception to the effect 

{
    "hint": "No operator matches the given name and argument type(s). You might 
need to add explicit type casts.",
    "details": null,
    "code": "42883",
    "message": "operator does not exist: integer[] - integer[]"
}

However,  If I write a similar test function and attempt similar array 
arithmetic successfully from a different schema in a non-trigger function It 
recognizes the intarray methods.

CREATE OR REPLACE FUNCTION admin.djd_test()
  RETURNS integer[] AS
$BODY$
DECLARE
    _old_tag_ids INTEGER[];
    _new_tag_ids INTEGER[];
   

BEGIN
    _old_tag_ids := ARRAY[1,2,3];
    _new_tag_ids := ARRAY[3,4,5];

    RETURN _old_tag_ids - _new_tag_ids;

END;
$BODY$
  LANGUAGE plpgsql VOLATILE


Of course in the trigger function  the declared int[] arrays  the content is 
dynamically initialized.
Any suggestions as to why the int[] operations are not understood in the 
trigger context.?

.
Thanks


Dave Day



Reply via email to