pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: "D'Arcy" "J.M." Cain <darcy@druid.net>
Cc: enrique@xpress.es
Cc: pgsql-interfaces@postgreSQL.org
Subject: Re: [INTERFACES] Ghost insert
Date: Thu, 23 Dec 1999 10:36:15 -0500
Message-ID: <6506.945963375@sss.pgh.pa.us> (raw)
In-Reply-To: <m1219Qp-0000daC@druid.net>
References: <m1219Qp-0000daC@druid.net>

"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



view thread (9+ messages)  latest in thread

Message-ID: <6506.945963375@sss.pgh.pa.us>
Permalink:  ../6506.945963375@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6506.945963375@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, darcy@druid.net, enrique@xpress.es
  Subject: Re: [INTERFACES] Ghost insert
  In-Reply-To: <6506.945963375@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox