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

From JanWieck@t-online.de (Jan Wieck)
Subject Re: [BUGS] problem with view and case - please help
Date
Msg-id 200007211102.NAA04015@hot.jw.home
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 wrote:
> I repost my message because it seems that my previous post don't go on
>
> i use [PostgreSQL 6.5.2 on i686-pc-linux-gnu, compiled by gcc 2.95.2]
> rpm version of Linux Mandrake 7.02
>

    That's  definitely  the  problem.  I  cannot recreate it with
    current CVS sources.

    The view generates a rewrite rule of ~40K. So v6.5.2 wouldn't
    be  able  to  store  it  anyway. 7.0 should, because it seems
    extremely good compressable (octet length of 2.7K).

    So give our latest release a try.

> i try this query :
>
> [ange@ange ange]$ psql zonecommerce -h 192.0.1.84 -u -f toto.sql
> Username: postgres
> Password:
>
> DROP VIEW liste_browser ;
> ERROR:  Rule or view 'liste_browser' not found   <-------- this ok
> because view does not exist at this time
> CREATE VIEW browser
> AS
> SELECT
> agent_i,
> CASE
> WHEN agent_i LIKE '%MSIE 2.0;%' THEN 'Internet Explorer 2.0'
> WHEN agent_i LIKE '%MSIE 3.0;%' THEN 'Internet Explorer 3.0'
> WHEN agent_i LIKE '%MSIE 3.0a;%' THEN 'Internet Explorer 3.0a'
> WHEN agent_i LIKE '%MSIE 3.0B;%' THEN 'Internet Explorer 3.0B'
> WHEN agent_i LIKE '%MSIE 3.01;%' THEN 'Internet Explorer 3.01'
> WHEN agent_i LIKE '%MSIE 3.02;%' THEN 'Internet Explorer 3.02'
> WHEN agent_i LIKE '%MSIE 4.0b1;%' THEN 'Internet Explorer 4.0 beta 1'
> [...]

    OTOH, the previous suggestion of using a function seems  more
    appropriate.  PL/Tcl  for  example  has very powerful regular
    expression capabilities, that could simplify it alot.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



pgsql-general by date:

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