Re: [INTERFACES] Ghost insert

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "D'Arcy" "J(dot)M(dot)" Cain <darcy(at)druid(dot)net>
Cc: enrique(at)xpress(dot)es (Enrique Rodriguez Lazaro), pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] Ghost insert
Date: 1999-12-23 15:36:15
Message-ID: 6506.945963375@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

"D'Arcy" "J.M." Cain <darcy(at)druid(dot)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

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Enrique Rodriguez Lazaro 1999-12-23 16:16:16 Re: [INTERFACES] Ghost insert
Previous Message Tom Lane 1999-12-23 15:15:55 Re: [INTERFACES] Ghost insert