agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: garret <garretlewis@gmail.com>
To: pgsql-sql@postgresql.org
Subject: update tables with instead of trigger after update of view
Date: Tue, 27 Feb 2018 10:59:22 -0700 (MST)
Message-ID: <1519754362818-0.post@n3.nabble.com> (raw)
Hi I have views created from several tables. I would like to create a
function with Plpgsql that updates the underlying tables rather than the
view with a do instead trigger. I have been able to get a working example of
what I want in the link below. The thing is, I would rather try to create a
more dynamic function instead of creating an if statement for each column.
Here's my sql fiddle <http://sqlfiddle.com/#!17/d63dc/2; where I show the
end result of what I would like to happen but with a more manual approach of
hard coding in the column and table to update.
I have also posted on DBA stackexchange
<https://dba.stackexchange.com/questions/198412/automate-update-columns-in-a-view-with-trigger-functi...;
but got no responses I was hoping someone on this forum could help, or let
me know if this is not realistically possible.
Thank you
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-sql-f2142323.html
Message-ID: <1519754362818-0.post@n3.nabble.com>
Permalink: ../1519754362818-0.post@n3.nabble.com/
Also on: postgresql.org/message-id/1519754362818-0.post@n3.nabble.com
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-sql@postgresql.org
Cc: garretlewis@gmail.com
Subject: Re: update tables with instead of trigger after update of view
In-Reply-To: <1519754362818-0.post@n3.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox