rules over multiple tables

From: Daniel Grob <dgrob(at)gmx(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: rules over multiple tables
Date: 2002-03-21 08:47:37
Message-ID: 7538.1016700457@www12.gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi all,

I'm new to Postgresql (using Postgresql 7.1.3) and I want to create rules.

I have a Database which has two tables (Addresses and Contacts) and I
created views (like in the documentation, it works), and I want to create rules for
insert, update and delete.

The syntax for the insert-rule I found (and it works), but nothing about how
to create update and delete rules over two tables. In the documentation, I
only found examples how to create rules over one table (this works, but I want
it over two tables).

The syntax I used for insert in two tables:

create rule view_test_insert as on insert to view_test do instead (
insert into "ADDRESSES" ("ID_ADDR" , "COMPANY" , etc...)
values (new."ID_ADDR" , new."COMPANY" , etc...);
insert into "CONTACTS" ("ID" , "C_CATEGORY" , etc...)
values (new."ID" , new."C_CATEGORY" , etc...);
);

I tried update and delete whit that syntax but it dosn't work ERROR:
parser: parse error at or near "(".

Does anyone know the solution for my problem?

Thank you!

--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Nick Haw 2002-03-21 10:36:57 Re: [NOVICE] Conditional constraint?
Previous Message Josh Berkus 2002-03-20 23:07:58 Re: Approximate string matching?