Re: ERROR: operator does not exist: integer = integer[]

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: cesar_cast <cesar(dot)cast(dot)more(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: ERROR: operator does not exist: integer = integer[]
Date: 2012-04-16 14:30:32
Message-ID: CAFj8pRBJH1AtYtpwSrXvJsz7VgLr1nZW98cfZQevrhTtD6C0-w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello

this is not error, you cannot use predicate IN in this context

use =ANY instead

postgres=> select 10 = ANY(ARRAY[1,2,3]);
?column?
----------
f
(1 row)

postgres=> select 10 = ANY(ARRAY[1,2,3,10]);
?column?
----------
t
(1 row)

Regards

Pavel Stehule

2012/4/11 cesar_cast <cesar(dot)cast(dot)more(at)gmail(dot)com>:
> I have the following
>
> select *
> from   employee AS e
> where  (e.id) IN  (ARRAY[3,1]);
>
> I have the following mistake
> ERROR:  operator does not exist: integer = integer[]
> LINE 3: where  (e.id) IN  (ARRAY[3,1]);
>                      ^
> HINT:  No operator matches the given name and argument type(s). You might
> need to add explicit type casts.
>
> ********** Error **********
>
> ERROR: operator does not exist: integer = integer[]
> SQL state: 42883
> Hint: No operator matches the given name and argument type(s). You might
> need to add explicit type casts.
> Character: 45
>
>
> Can anybody explain me?
>
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/ERROR-operator-does-not-exist-integer-integer-tp5634039p5634039.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Dennis 2012-04-18 10:11:54 Uniform UPDATE queries
Previous Message Jasen Betts 2012-04-12 12:26:18 Re: How to html-decode a html-encoded field