problem with array query

From: Grant Maxwell <grant(dot)maxwell(at)maxan(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: problem with array query
Date: 2009-09-28 01:27:54
Message-ID: 858C4168-CAD0-4237-AAD1-C989E2CE3B45@maxan.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Folks

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

CREATE TABLE tblretrain
(
pkretrainid integer NOT NULL,
mailid integer NOT NULL,
train_to smallint NOT NULL,
owners character varying(1024)[],
bayes_trained boolean DEFAULT false,
contents text NOT NULL,
CONSTRAINT tblretrain_pk PRIMARY KEY (pkretrainid)
)

The problem is that it generates an error:

ERROR: array value must start with "{" or dimension information
********** Error **********
ERROR: array value must start with "{" or dimension information
SQL state: 22P02

It seems as though postgres is not recognising owners as an array.

Any suggestions please ?
regards
Grant

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-09-28 01:42:58 Re: problem with array query
Previous Message Scott Marlowe 2009-09-28 01:22:47 Re: PostgreSQL reads each 8k block - no larger blocks are used - even on sequential scans