Re: [SQL] hi all......................!!

From: Markus Schaber <schabi(at)logix-tt(dot)com>
To: AKHILESH GUPTA <akhilesh(dot)davim(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [SQL] hi all......................!!
Date: 2006-01-25 09:27:24
Message-ID: 43D7447C.1000907@logix-tt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2006-01-25 09:33:18 Re: Constraint that compares and limits field values
Previous Message Richard Huxton 2006-01-25 09:24:28 Re: [SQL] hi all......................!!

Browse pgsql-sql by date

  From Date Subject
Next Message Mario Splivalo 2006-01-25 14:12:28 Changing the transaction isolation level within the stored procedure?
Previous Message Richard Huxton 2006-01-25 09:24:28 Re: [SQL] hi all......................!!