i've got table structure like this:
Code: Select all
CREATE TABLE customers
(
id serial,
type_id integer,
name text NOT NULL DEFAULT ''::text,
street text,
zip text,
city text,
phone text,
email text,
contact_person text,
www text,
last_contact date,
next_contact date,
status integer NOT NULL DEFAULT 0,
CONSTRAINT pkey_customers PRIMARY KEY (id ),
CONSTRAINT fk_customers__type_id FOREIGN KEY (type_id)
REFERENCES company_types (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
);
With simple filter like "status=0" it's ok.
But when i try to use more complex filter: "status=0 and last_contact is not null" filter doesn't seem to be changed at all.
Furthermore when i try to apply filter: "status=0 and coalesce(phone,'')<>'' i get error: "Function coalesce was not found".
If You'll need more details about my design or code fragment's i'll be glad to provide them:)
Best regards,
Marek