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 1qIvXo-0006eI-GF for pgsql-general@arkaria.postgresql.org; Mon, 10 Jul 2023 18:23:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qIvXn-0005HL-3W for pgsql-general@arkaria.postgresql.org; Mon, 10 Jul 2023 18:23:31 +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 1qIvXm-0005HA-Q2 for pgsql-general@lists.postgresql.org; Mon, 10 Jul 2023 18:23:30 +0000 Received: from smtp104.iad3a.emailsrvr.com ([173.203.187.104]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qIvXk-0037Mp-5J for pgsql-general@lists.postgresql.org; Mon, 10 Jul 2023 18:23:29 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp22.relay.iad3a.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 864F85E68; Mon, 10 Jul 2023 14:23:26 -0400 (EDT) Subject: Re: Trigger Function question Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Content-Type: text/plain; charset=us-ascii From: Christophe Pettus X-Priority: 3 In-Reply-To: <1875078143.170839.1689013230630@connect.xfinity.com> Date: Mon, 10 Jul 2023 11:23:23 -0700 Cc: "pgsql-general@lists.postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <1875078143.170839.1689013230630@connect.xfinity.com> To: DAVID ROTH X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Classification-ID: 6242254d-66a3-49e4-ad61-fea757bab650-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jul 10, 2023, at 11:20, DAVID ROTH wrote: >=20 > In a trigger function, is there a way to get a list of all of the = columns in the triggering table? You can get the table that the trigger fired on with TG_TABLE_SCHEMA and = TG_TABLE_NAME, and then query the system catalogs to get a list of = columns. But can you tell us a bit more about your use-case? You may be able to = write the trigger in such a way that it doesn't need to change behavior = based on the columns.=