Re: [INTERFACES] Ghost insert - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: [INTERFACES] Ghost insert
Date
Msg-id 6506.945963375@sss.pgh.pa.us
Whole thread Raw
In response to Re: [INTERFACES] Ghost insert  ("D'Arcy" "J.M." Cain <darcy@druid.net>)
Responses Re: [INTERFACES] Ghost insert  ("D'Arcy" "J.M." Cain <darcy@druid.net>)
List pgsql-interfaces
"D'Arcy" "J.M." Cain <darcy@druid.net> writes:
> Thus spake Enrique Rodriguez Lazaro
>> I can't do a simple 'insert' from libpq.

> Just guessing here but is it possible that clientes is a view and you are
> seeing the underlying table when you select after the insert?

Oooh, good thought --- but you are explaining it backwards.  If clientes
was made with CREATE VIEW, then an INSERT into clientes would in fact
insert data into clientes --- but you'd never see it again, because any
SELECT from clientes would be redirected to whatever the view is of.
(I've been burnt by that myself ;-).)

If you want to insert/update on a view, you need to provide ON INSERT,
ON UPDATE, ON DELETE rules that tell how to modify the underlying tables
appropriately.  The system will *not* try to intuit these for you.
        regards, tom lane


pgsql-interfaces by date:

Previous
From: Tom Lane
Date:
Subject: Re: [INTERFACES] Ghost insert
Next
From: Enrique Rodriguez Lazaro
Date:
Subject: Re: [INTERFACES] Ghost insert