Re: Multi-Table Insert/Update Strategy - Use Functions/Procedures? - Mailing list pgsql-general

From Don Parris
Subject Re: Multi-Table Insert/Update Strategy - Use Functions/Procedures?
Date
Msg-id CAJ-7yokvY-zs5D+WMsV_Q0CWP3g7Q3pBocNqQReeYUq2TCCU2w@mail.gmail.com
Whole thread Raw
In response to Re: Multi-Table Insert/Update Strategy - Use Functions/Procedures?  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
On Wed, Jan 27, 2016 at 6:24 PM, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Wed, Jan 27, 2016 at 4:03 PM, Don Parris <parrisdc@gmail.com> wrote:

<snip>
 
​Parameter passing and variables are client-side considerations.  You haven't told us how you plan to execute the SQL.

​IMO the most straight-forward API is a function.  Whether you implement that function using a updating CTE or a sequence of separate SQL commands is up to you to decide and, if performance matters, benchmark.

Comparing a CTE and function in general doesn't really do much good.  There are many non-performance concerns involved and the specific usage pattern involved will matter greatly in determining overhead.

 
Thanks David, that makes sense.  My main front-end - at the moment - is LibreOffice Base.  With Base, I can probably just create forms using the underlying tables.  That said, I may also want to write a Python front-end, in which case I would prefer to let the database do the work it was designed to do.

Don
--
D.C. Parris, FMP, Linux+, ESL Certificate
Minister, Security/FM Coordinator, Free Software Advocate
GPG Key ID: F5E179BE

pgsql-general by date:

Previous
From: Ivan Voras
Date:
Subject: Re: Catalog bloat (again)
Next
From: "David G. Johnston"
Date:
Subject: Re: Request - repeat value of \pset title during \watch interations