Grant Maxwell <grant.maxwell@maxan.com.au> writes:
> According to the 8.3 docs I should be able to write:
> select * from tblretrain where 'ms-ap-t2-02c9' NOT IN (owners);
> where owners is an array per the following definition
> owners character varying(1024)[],
No, what you can write is "<> ALL", not NOT IN.
> It seems as though postgres is not recognising owners as an array.
It's trying to parse the literal as an array so that it can do a
plain equality comparison against the owners column.
You probably read the part of the docs where it says that
x NOT IN (SELECT ...) is equivalent to x <> ALL (SELECT ...).
Which is true, but it has nothing to do with the non-sub-SELECT syntax.
Without a sub-SELECT, we have two cases:
x NOT IN (y,z,...) expects x,y,z to all be the same type.
x <> ALL (y) expects y to be an array of x's type.
Got it?
regards, tom lane