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

From: "Day, David" <david(dot)day(at)redcom(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: plpgsql and intarray extension; int[] - int[] operator does not exist ?
Date: 2018-11-19 17:12:50
Message-ID: 0fd14b7dff1741b988d4f907af745cc4@exch-02.redcom.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2018-11-19 17:46:33 Re: pgconf eu 2018 slides entry missing from https://wiki.postgresql.org/wiki/PostgreSQL_Related_Slides_and_Presentations
Previous Message Stephen Frost 2018-11-19 15:35:39 Re: pgconf eu 2018 slides entry missing from https://wiki.postgresql.org/wiki/PostgreSQL_Related_Slides_and_Presentations