Re: [BUGS] problem with view and case - please help - Mailing list pgsql-general

From Tom Lane
Subject Re: [BUGS] problem with view and case - please help
Date
Msg-id 13008.964189627@sss.pgh.pa.us
Whole thread Raw
In response to problem with view and case - please help  (Ange Michel POZZO <poange@technologist.com>)
List pgsql-general
Ange Michel POZZO <poange@technologist.com> writes:
> CREATE VIEW browser
> AS
> SELECT
> agent_i,
> CASE
> < massive CASE expression >
> ELSE agent_i END AS navigateur, count (agent_i)
> as total from access group by agent_i;
> pqReadData() -- backend closed the channel unexpectedly.

Not sure why you are seeing a crash instead of a complaint, but
there's no chance of making such a huge VIEW expression work in
6.5 --- the rule text won't fit in 8K.  Try it in 7.0.2 (which
has still got the 8K limit, but at least it compresses the text).

BTW I tend to agree with the other comment that this seems a clumsy
way to go about it.  I'd think about making a table containing a
pattern column and a browser-name column and doing the view as a
join.  Might be a little tricky to ensure you get only one match,
however ...

            regards, tom lane

pgsql-general by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: [HACKERS] 8Ko limitation
Next
From: Ange Michel POZZO
Date:
Subject: Re: [SQL] problem with view and case - please help