Re: virtual fields on VIEW? - Mailing list pgsql-general

From raptor@tvskat.net
Subject Re: virtual fields on VIEW?
Date
Msg-id 20040618173821.37ea99d2@bugs
Whole thread Raw
In response to Re: virtual fields on VIEW?  (Richard Huxton <dev@archonet.com>)
Responses Database corruption using 7.4.1
Re: virtual fields on VIEW?
List pgsql-general
> SELECT ...
>    CASE
>      WHEN date < CURRENT_DATE THEN 'green'::text
>      WHEN date > CURRENT_DATE THEN 'red'::text
>      ELSE 'blue'::text
>    END
>    AS state,
>    (t1.field2 || t2.fieldA) AS stuff
> FROM ...

]- aha thanx..

> >>> BOTH state and stuff will be only available for SELECTs on the
> >>> view i.e. they are not updatable ..
>
> All views in PG are read-only. If you want to make the view updatable,
> you'll need to write your own rules (see manuals for details).

]- yep, i have to write RULES how updates/inserts will be propagandated( i made a quick read
of this section from the docs..)

> --
>    Richard Huxton
>    Archonet Ltd
>

pgsql-general by date:

Previous
From: "Najib Abi Fadel"
Date:
Subject: Re: virtual fields on VIEW?
Next
From: "Florian G. Pflug"
Date:
Subject: Variadic functions in plpgsql?