Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2012
    Posts
    2

    Unanswered: How to access the extension's operator installed with schema ?

    Hello,

    I'm having a problem accessing an extension's operator installed with a schema.

    PostgreSQL version: 9.1

    CREATE SCHEMA inty AUTHORIZATION psql_user;
    CREATE EXTENSION intarray SCHEMA inty;
    SELECT inty.uniq(ARRAY[1,2,3]); --> OK, result: {1,2,3}

    How can I access the operator with inty schema?

    SELECT ARRAY[1,2,3] + 10; --> returns "ERROR: operator does not exist: integer[] + integer" because the default operator (+) has other definition
    SELECT ARRAY[1,2,3] fast.+ 10; --> NOT OK

  2. #2
    Join Date
    May 2008
    Posts
    277
    Well, it would help if you used the right operator:
    PostgreSQL: Documentation: 9.1: Array Functions and Operators

    However, to schema-qualify your operators, look here:
    PostgreSQL: Documentation: 9.1: Schemas
    Last edited by futurity; 09-14-12 at 13:14.

  3. #3
    Join Date
    Sep 2012
    Posts
    2
    I got an answer from another website:

    "The easy way is to change your search_path to include inty.
    If you really don't want to do that, you can write OPERATOR(inty.+)"

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •