Search Postgresql Archives

plpgsql and intarray extension; int[] - int[] operator does not exist ?

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

 




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







[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