Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMCcj-0001yW-Jo for pgsql-general@arkaria.postgresql.org; Wed, 08 Apr 2020 15:28:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jMCch-0004ZT-PN for pgsql-general@arkaria.postgresql.org; Wed, 08 Apr 2020 15:28:15 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMCcg-0004WP-I3 for pgsql-general@lists.postgresql.org; Wed, 08 Apr 2020 15:28:15 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMCcc-0000ai-UW for pgsql-general@lists.postgresql.org; Wed, 08 Apr 2020 15:28:13 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 42395729; Wed, 8 Apr 2020 11:28:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 08 Apr 2020 11:28:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=F XuQdCiR0wKqavGXxUhMQLdSlD4O1fIp8s/3XTFfUD8=; b=TheD0YnLwPqQoFSQ8 aQPf8vTQbU4PR13T0EkdL4iX56IXyI9JBJDcNiNZJb9v5+x6+LItGGhbT8kYcund mu+JcQd9Ox/WywdC6DaRGnDRonigEjUtIo2r/d8q7duvwl2Y5qQbIwK7zrECmYd7 bEifacpR48N52dNNRLR1Z2vZQ+ZFowoQ3MrwkHPJ+0lrqBkdCwejlaBIiEGH7LOE Kvl+Os5AUgk7L9dfcJrY0KT6zb8CYBok/xitdsvMYMO+frjPBaCNLFSza0a8XZP9 qS5R3upx83WMC7JzB5Y8D9IXU2f4+MGEATrcGp9yKLWC0s4ibFcnC3WqgS5fbq+h IR/hA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=FXuQdCiR0wKqavGXxUhMQLdSlD4O1fIp8s/3XTFfU D8=; b=o4Ro+AaToRjNE62svVtJ6pUS42PzSaYj5IJy7W8lSigXe15OgE73OVJsf Mx2A+SvLEGNvJxHJf6ppQ+Wvt65q/+f6AnZc/jDAuWQxM1/UZyW+rpfncuvW00rb xcTYyaQblGz+nmnGHWI53wJsQFz27z+6ZQWJbsW7kYonJKOItFq5ZMgtav33V6Mo IZYst3lfOO+8W19RMZjmGrJ9SpFdDujz7joeuIwLXyHQ9JlW7xpPCSDDzTZw02xX qa6a4ztpMoWxJ8qKsQ7FLJeXeLbLWeQC7qrdO3A8ly9c4BRhqvo2KWKwUvK9EPLe VrECsZCKw5ojKowrPTfHlvDz2KHSA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudejgdekkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecukfhppeejhedrudejvddrledtrdelvdenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvg hrrdgtohhm X-ME-Proxy: Received: from [192.168.1.10] (75-172-90-92.tukw.qwest.net [75.172.90.92]) by mail.messagingengine.com (Postfix) with ESMTPA id EBCD5328005D; Wed, 8 Apr 2020 11:28:07 -0400 (EDT) Subject: Re: Best method to display table information in predefined formats To: Mark Bannister , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: <4864ce60-344d-12de-36a0-faee9fcdc346@aklaver.com> Date: Wed, 8 Apr 2020 08:28:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 4/8/20 6:39 AM, Mark Bannister wrote: > 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. I am not understanding what you are after, especially this part: "The return value is typically displayed the ui in views of the table" Are you saying the functions are called to fill in fields in a UI form or to populate a database side view? > > -- > > Mark B > -- Adrian Klaver adrian.klaver@aklaver.com