Re: operator does not exist: smallint <> smallint[] - Mailing list pgsql-hackers

From Tom Lane
Subject Re: operator does not exist: smallint <> smallint[]
Date
Msg-id 13131.1228829074@sss.pgh.pa.us
Whole thread Raw
In response to operator does not exist: smallint <> smallint[]  (Euler Taveira de Oliveira <euler@timbira.com>)
Responses Re: operator does not exist: smallint <> smallint[]
List pgsql-hackers
Euler Taveira de Oliveira <euler@timbira.com> writes:
> I saw a report at .br mailing list [1] complaining about the message's title.
> I do not try to investigate it.  Am I missing something?

> euler=# select attname from pg_attribute where attnum > 0 and attnum <>
> ALL(select conkey from pg_constraint where conrelid = attrelid and contype = 'p');
> ERROR:  operator does not exist: smallint <> smallint[]

It's entirely right: there's no such operator.



Oh, you wanted a way to write the query correctly?  I think what this
person wants might be something like

select attname from pg_attribute where attnum > 0 and not attisdropped
and not exists (select 1 from pg_constraint where attnum = ANY(conkey)               and conrelid = attrelid and
contype= 'p');
 

... although that produces quite a lot of rows, so some additional
constraint is probably wanted too.
        regards, tom lane


pgsql-hackers by date:

Previous
From: ohp@pyrenet.fr
Date:
Subject: Re: cvs head initdb hangs on unixware
Next
From: Peter Eisentraut
Date:
Subject: Re: WIP: default values for function parameters