Best method to display table information in predefined formats

From: Mark Bannister <mark(at)injection-moldings(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Best method to display table information in predefined formats
Date: 2020-04-08 13:39:35
Message-ID: f215bb10-3229-05d4-0025-3b5ee9a07a7b@injection-moldings.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am converting an application to postgresql.  On feature I have is
functions that return custom displays of a table row.  For instance the
company display function might display just the company name, or company
name + other information.  It may also call other displays, for
instance, address or phone numbers which in turn have display
functions.  What is returned depends on context and other parameters. 
The return value is typically displayed the ui in views of the table. 
For instance a listing of purchase orders could list PO number, and use
the company display function to list the company information.  Depending
on the display it could show just the company name or complete details
of the company (in the context of the PO).

There is also a generic function that will display per-defined default
fields so that a custom function is not required for each table.

What is the best way to reproduce this and take advantage of postgresql
caching?  These functions can be called a lot.

--

Mark B

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2020-04-08 14:03:03 Re: Performance degradation if query returns no rows and column expression is used after upgrading to 12
Previous Message Andrus 2020-04-08 13:34:36 Re: Performance degradation if query returns no rows and column expression is used after upgrading to 12