Обсуждение: hi all......................!!

Поиск
Список
Период
Сортировка

hi all......................!!

От
AKHILESH GUPTA
Дата:
hello everybody
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...................!!

--
Thanks & Regards,
Akhilesh
DAV Institute of Management
Faridabad(Haryana)
GSM:-(+919891606064)
          (+911744293789)

"FAILURES CAN BE FORGIVEN BUT AIMING LOW IS A CRIME"

Re: hi all......................!!

От
Richard Huxton
Дата:
AKHILESH GUPTA wrote:
> hello everybody
> 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??

There is no automatic updating of views at present.

You can write your own RULES though to do updates - see the manuals for
details.

--
   Richard Huxton
   Archonet Ltd

Re: hi all......................!!

От
Markus Schaber
Дата:
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

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

От
Tino Wildenhain
Дата:
AKHILESH GUPTA schrieb:
> hello everybody
> 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...................!!

Yes it is. All you have to do is to add a rule for updating in the way
you want it to work. When you use pgadmin3 or such tools, you see that
a view is basically a table with one rule for select. For Insert, update
you can add a rule any time.

HTH
Tino Wildenhain