Re: [SQL] Using CASE in plpgsql causes 'ERROR: cache lookup failed'

2010-04-14 Thread Tom Lane
Mario Splivalo writes: > When I call 'service_something' function and provide nonexistent > service_id I get this error: > ERROR: cache lookup failed for type 37 Hmm. Looks like exec_eval_expr should be more careful about setting a result datatype when the expression returns no rows. NULL is

[SQL] Using CASE in plpgsql causes 'ERROR: cache lookup failed'

2010-04-14 Thread Mario Splivalo
I have an enum-type, like this: CREATE TYPE type_enum_service_type AS ENUM ('Banner', 'Ticker', 'Memo'); Then I have a table, like this: CREATE TABLE services ( service_id integer NOT NULL, service_type type_enum_service_type NOT NULL, service_keyword character varying NOT NULL, servi