Re: Function Speed vs UI Function Speed

From: Joshua Drake <jd(at)commandprompt(dot)com>
To: susan(dot)hurst(at)brookhurstdata(dot)com
Cc: Discuss List Postgres <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Function Speed vs UI Function Speed
Date: 2020-08-31 17:51:48
Message-ID: CAJvJg-Tjb_D1zYK1mQshV3MC-aHDJ-LB6rg2-eMtP7jjT9ziAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Aug 31, 2020 at 10:32 AM Susan Hurst <susan(dot)hurst(at)brookhurstdata(dot)com>
wrote:

>
> For example, a batch load script that inserts multiple rows into a table
> may call an insert function within a cursor to populate each row into
> the target table. Meanwhile, a non-technical business user may want to
> create only one entity via a UI. However, the UI must have validations
> and helpful messages to to user so the insert works....or won't, but at
> least user would know what they need to do differently to get to a
> successful outcome.
>

I think you have both. You don't want the round trip of having the database
throw an exception in this example. So yes, you have the validations within
the UI for a higher level of success before submission. However, you still
want the proper constraints on the database itself as it is the canonical
source for your data. Further, you never know when someone else is going to
connect to the database in something that isn't your application.

JD

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2020-08-31 21:56:27 Re: [EXTERNAL] Re: Numeric data types
Previous Message Susan Hurst 2020-08-31 17:32:44 Function Speed vs UI Function Speed