Re: virtual fields on VIEW?

From: "raptor(at)tvskat(dot)net" <raptor(at)tvskat(dot)net>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: virtual fields on VIEW?
Date: 2004-06-18 14:38:21
Message-ID: 20040618173821.37ea99d2@bugs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Larry Rosenman 2004-06-18 14:52:38 Re: SCO embraces MySQL
Previous Message Richard Huxton 2004-06-18 13:48:18 Re: virtual fields on VIEW?