pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Day, David <david.day@redcom.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: plpgsql  and intarray extension;   int[] - int[]  operator does not exist ?
Date: Mon, 19 Nov 2018 17:12:50 +0000
Message-ID: <0fd14b7dff1741b988d4f907af745cc4@exch-02.redcom.com> (raw)



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






view thread (6+ messages)  latest in thread

Message-ID: <0fd14b7dff1741b988d4f907af745cc4@exch-02.redcom.com>
Permalink:  ../0fd14b7dff1741b988d4f907af745cc4@exch-02.redcom.com/
Also on:    postgresql.org/message-id/0fd14b7dff1741b988d4f907af745cc4@exch-02.redcom.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: david.day@redcom.com
  Subject: Re: plpgsql  and intarray extension;   int[] - int[]  operator does not exist ?
  In-Reply-To: <0fd14b7dff1741b988d4f907af745cc4@exch-02.redcom.com>
  References: <0fd14b7dff1741b988d4f907af745cc4@exch-02.redcom.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox