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 1nAbtz-0005XA-4i for pgsql-general@arkaria.postgresql.org; Thu, 20 Jan 2022 18:11:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nAbtx-0004Df-7Z for pgsql-general@arkaria.postgresql.org; Thu, 20 Jan 2022 18:11:13 +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 1nAbtw-0004DV-TE for pgsql-general@lists.postgresql.org; Thu, 20 Jan 2022 18:11:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAbtu-0006jT-S3 for pgsql-general@postgresql.org; Thu, 20 Jan 2022 18:11:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 20KIB4YF892317; Thu, 20 Jan 2022 13:11:04 -0500 From: Tom Lane To: Garfield Lewis cc: Laurenz Albe , PostgreSQL mailing lists Subject: Re: [EXT] Re: Can we get the CTID value In-reply-to: <6CCE2477-12BB-4287-9CE0-3DBFB3E6652D@lzlabs.com> References: <0745A2E3-4DD9-46E9-8E77-7CA95C7ECC63@lzlabs.com> <890419.1642701147@sss.pgh.pa.us> <6CCE2477-12BB-4287-9CE0-3DBFB3E6652D@lzlabs.com> Comments: In-reply-to Garfield Lewis message dated "Thu, 20 Jan 2022 18:00:53 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <892315.1642702264.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 20 Jan 2022 13:11:04 -0500 Message-ID: <892316.1642702264@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Garfield Lewis writes: > I think you are right in the case of INPUT/RECEIVE, however we should be= able to get that info during OUTPUT/SEND (I think) since it is fixed at t= hat point. At the time I return the information to the user I could augmen= t the output to add that information to the output. However, I still don't= know if it is even possible to get that information in those functions. I= s that at all possible? No, it's the same problem in reverse: the output function cannot know where the value came from. There is no hard and fast reason that it must have come out of a table, either. Consider something as simple as SELECT 'blah blah'::yourtype; This'll invoke the type's input function to parse the literal string, and later it'll invoke the output function to reconstruct a string to send to the client, and there's no table involved. regards, tom lane