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 1jMCpS-0002Um-UV for pgsql-general@arkaria.postgresql.org; Wed, 08 Apr 2020 15:41:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jMCpR-0006Kd-TJ for pgsql-general@arkaria.postgresql.org; Wed, 08 Apr 2020 15:41:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMCpQ-0006KV-Sf for pgsql-general@lists.postgresql.org; Wed, 08 Apr 2020 15:41:25 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jMCpN-0002K5-P9 for pgsql-general@lists.postgresql.org; Wed, 08 Apr 2020 15:41:24 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 75ED26DA; Wed, 8 Apr 2020 11:41:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 08 Apr 2020 11:41:19 -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=8 MZFI9r3kwevV4xr+cMJHXB1wHlauQnQ5wAZQQaYo8Y=; b=cHVLZrSLPocg1m6sa Kx8YMZ5DhUVCObRBxtL+u3GEZPNAY5LyhHN8qXUbeKRr+GArKZBHPmaPwZavehJX MgnE1yBiL8EcXFyH5V9VItmrtupLh9/GQ7jwIzDJ9oHvDVf4/an2iuJYZXoJujIs UbcaD18IkSkPHNEUcy+OoLUJpnWjBa2oa5vISBO7obxFW6TJKiSO3fBOV15vigzi iop7BCYQ//mrS6OHliji3KHnNAGq2emhZhrmXfHeV1cL3PHsxPUMz5gBt2DhEPDM 1C6m7zxh+ye2j0fCjLdnLL8qHbNQ2pnIc3HdAQYXOJpgOgci7L6AJl4EhTN0a5Uq fbaZw== 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=8MZFI9r3kwevV4xr+cMJHXB1wHlauQnQ5wAZQQaYo 8Y=; b=2ww+LDjYct9DHcAbIq0jJNSIiWHTI4NNxfD5RdPTERNZXSp6No8yKWWVf mfBF+ror/76Z4w0s8BMWsk0sAtSxxSRUsUrdkAxxmAnN0wfM0BjcemlLLQ1gRYtK B3OGZ+pi649Ponlz6KJLaEKfgg71nCk38AXMbBmRTohtj18dLM5+K5VR87OV9YEd dhcXm036CJa38afAmOW1e5ksNaz3rKHZiH9pLzSDiNQOwfN80lXQKKmYjMYqhJzb pKnkF++Ah5R06OYOhED9o1MAUdR7Pj9JTl2TD4cnMnAhemgTjPnvntq18Lq1VwGU dBh+deb9yAV/pwqslElT4dx2ip4WQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudejgdeludcutefuodetggdotefrodftvf 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 8671A328005D; Wed, 8 Apr 2020 11:41:18 -0400 (EDT) Subject: Re: Best method to display table information in predefined formats To: Mark Bannister , pgsql-general@lists.postgresql.org References: <4864ce60-344d-12de-36a0-faee9fcdc346@aklaver.com> <06157723-5788-11a4-be4b-0041b2ec1673@injection-moldings.com> From: Adrian Klaver Message-ID: <5100e5c9-d037-87c9-1d5d-2afcb5ea9a65@aklaver.com> Date: Wed, 8 Apr 2020 08:41:17 -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: <06157723-5788-11a4-be4b-0041b2ec1673@injection-moldings.com> 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 8:39 AM, Mark Bannister wrote: > > On 4/8/2020 10:28 AM, Adrian Klaver wrote: >> 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 >>> >> >> > > Yes.  That's correct. Which is correct filling in fields, populating a view or both? > > -- > > Mark B > -- Adrian Klaver adrian.klaver@aklaver.com