Rules

From: Jake Stride <nsuk(at)users(dot)sourceforge(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Rules
Date: 2005-04-09 09:40:57
Message-ID: 4257A329.3030103@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I'm a bit stuck about something (I think) I want to do with rules.

I have 2 schemas in a database - public and company1. I have a view in
company1 that is made with a left outer join on a table from public and
and a table from company1:

public.table
============
id serial

company1.table
==============
public_table_id int references public.table.id
some_data varchar

company.view
============
SELECT public.table.id, company1.table.some_data FROM public.table LEFT
OUTER JOIN company1.table ON
(public.table.id=company1.table.public_table)id)

What I need to do is, when somebody tries to update the view, if the row
does not exist in company1.table insert it, otherwise do an update.

Is using rules the best way to do it and if so how?

Thanks

Jake

Browse pgsql-novice by date

  From Date Subject
Next Message CiaMba 2005-04-09 11:32:22 2 questions: Installation And DB runtime creation
Previous Message Rodolfo J. Paiz 2005-04-09 03:47:47 Re: Getting running totals