Re: problem with view and case - please help - Mailing list pgsql-sql

From Volker Paul
Subject Re: problem with view and case - please help
Date
Msg-id 3978139A.3F12604F@dohle.com
Whole thread Raw
In response to problem with view and case - please help  (Ange Michel POZZO <poange@technologist.com>)
List pgsql-sql
> CREATE VIEW browser
> AS
> SELECT
> agent_i,
> CASE
> WHEN agent_i LIKE '%MSIE 2.0;%' THEN 'Internet Explorer 2.0'
> ...
> agent_i NOT LIKE '%compatible%' THEN 'Netscape'
> WHEN agent_i LIKE 'Mozilla/5.0 %' AND agent_i NOT LIKE '%MSIE%' AND
> agent_i NOT LIKE '%compatible%' THEN 'Netscape'
> WHEN agent_i LIKE 'Mozilla/6.0 %' AND agent_i NOT LIKE '%MSIE%' AND
> agent_i NOT LIKE '%compatible%' THEN 'Netscape'
> ELSE agent_i END AS navigateur, count (agent_i)
> as total from access group by agent_i;
> pqReadData() -- backend closed the channel unexpectedly.
>         This probably means the backend terminated abnormally
>         before or while processing the request.
> We have lost the connection to the backend, so further processing is
> impossible.  Terminating.

Query limit exceeded? At least that CASE statement looks rather clumsy,
suggest using a function instead.

V.Paul


pgsql-sql by date:

Previous
From: Ange Michel POZZO
Date:
Subject: problem with view and case - please help
Next
From: "Emils Klotins"
Date:
Subject: Re: referencing serials