Re: Multi-Table Insert/Update Strategy - Use Functions/Procedures?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: bret_stern(at)machinemanagement(dot)com
Cc: Don Parris <parrisdc(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Multi-Table Insert/Update Strategy - Use Functions/Procedures?
Date: 2016-01-27 20:32:34
Message-ID: CAKFQuwZVBZRX059DPc7WGC03sQeapHOaJ_PGe5z_WdmcRkBSbw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jan 27, 2016 at 1:28 PM, Bret Stern <
bret_stern(at)machinemanagement(dot)com> wrote:

> On this track (possibly unrelated)...can a view be used as part of the
> multi table update
> Just curious
>

​Never done so myself but - I believe so though doing so over a one-to-many
relationship can be tricky.

That said probably no trickier than do so via a function. In both
scenarios you need to use arrays to approximate sets of records and then
decompose the array to insert the relevant records in the "many" table.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua Berkus 2016-01-27 21:25:36 Re: Multi-Table Insert/Update Strategy - Use Functions/Procedures?
Previous Message Bret Stern 2016-01-27 20:28:51 Re: Multi-Table Insert/Update Strategy - Use Functions/Procedures?