Re: Problems With VIEWS

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Jeanna Geier <jgeier(at)apt-cafm(dot)com>, Adam Rich <adam(dot)r(at)sbcglobal(dot)net>, 'pgsql-general' <pgsql-general(at)postgresql(dot)org>
Subject: Re: Problems With VIEWS
Date: 2007-01-11 14:36:34
Message-ID: 943440.66350.qm@web31814.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> So, herein probably lies my problem with the "Cannont insert into a view"
> error I'm getting anytime I'm attempting to access it from my program -
> there are no rules set up for them, right?

Correct, without insert rules you will not be able to add new records to the underlying tables of
a view.

> So, if I manually enter them for
> each VIEW and do a BACKUP and then RESTORE, should they still be attached to
> each of the VIEWS?

What exactly would you be backing up and restoring? I expect that you can add new rules to these
views from psql without even disconnecting from CASEStudio or anyother client program. Once the
rulse are added, inserts that did not work before will start working.

> I would think CASEStudio would have this capabilty to
> export these, but at this point I need to get our application and the VIEWS
> working and if I need to take the time to enter each RULE for the VIEWS
> manually, so be it.

Either way. I like to create sql files with all of the DDL for creating the view and rules.
Overtime, if I need to change my view or reconfigure the rules, I can edit my sql file and then
call it up in psql using "\e <view_def.sql>"

I use the "CREATE OR REPLACE VIEW" syntax to achieve this.

Regards,
Richard Broersma Jr.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bernd Helmle 2007-01-11 15:02:25 Re: Problems With VIEWS
Previous Message Alban Hertroys 2007-01-11 14:12:32 Re: Optimize expresiions.