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

Started by xoipover 13 years ago3 messagesgeneral
Jump to latest
#1xoip
sorin.mircioiu@gmail.com

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

--
View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-access-the-extension-s-operator-installed-with-schema-tp5724032.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: xoip (#1)
Re: How to access the extension's operator installed with schema ?

xoip <sorin.mircioiu@gmail.com> writes:

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?

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.+)
but that's pretty inconvenient.

regards, tom lane

#3xoip
sorin.mircioiu@gmail.com
In reply to: Tom Lane (#2)
Re: How to access the extension's operator installed with schema ?

Thank you for the quick answer, problem solved.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-access-the-extension-s-operator-installed-with-schema-tp5724032p5724437.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.