Re: [SQL] hi all......................!! - Mailing list pgsql-general

From Markus Schaber
Subject Re: [SQL] hi all......................!!
Date
Msg-id 43D7447C.1000907@logix-tt.com
Whole thread Raw
In response to hi all......................!!  (AKHILESH GUPTA <akhilesh.davim@gmail.com>)
List pgsql-general
Hi, Akilesh,

AKHILESH GUPTA wrote:

> i am new to this mailing list. this is my first mail to this group.
> i jussst want to confirm that whether is it possible to update a view or
> not??
> i think you all help me in solving my queries in future...................!!

Do you think about issuing UPDATE commands on a view, or do you think
about updating the view definition itsself?

The former is possible if you add the appropriate 'ON UPDATE DO INSTEAD'
Rules to the view, see
http://www.postgresql.org/docs/8.1/static/rules.html and
http://www.postgresql.org/docs/8.1/static/sql-createrule.html


The latter is easily possible if the updated view definition has equal
column definitions, just use "CREATE OR UPDATE VIEW ..." instead of
"CREATE VIEW ..." to update the view.

If your column definitions change, then you'll have to DROP the view
before reCREATEing it, maybe it's best to encapsulate this inside a
transaction or use a scheduled downtime.


Btw, it seems that your '.'-key is broken and chatters. :-)


HTH,

Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: [SQL] hi all......................!!
Next
From: Richard Huxton
Date:
Subject: Re: Constraint that compares and limits field values