Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1emOnA-0007pb-0m for pgsql-general@arkaria.postgresql.org; Thu, 15 Feb 2018 19:02:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emOn9-0000QP-4D for pgsql-general@arkaria.postgresql.org; Thu, 15 Feb 2018 19:01:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1emOn8-0000QE-Sd for pgsql-general@lists.postgresql.org; Thu, 15 Feb 2018 19:01:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1emOn6-0003BH-8Q for pgsql-general@postgresql.org; Thu, 15 Feb 2018 19:01:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w1FJ1rjc028695; Thu, 15 Feb 2018 14:01:53 -0500 From: Tom Lane To: Ken Tanzer cc: PG-General Mailing List Subject: Re: Trigger (or something similar) on table rename? In-reply-to: References: Comments: In-reply-to Ken Tanzer message dated "Thu, 15 Feb 2018 10:52:51 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28693.1518721313.1@sss.pgh.pa.us> Date: Thu, 15 Feb 2018 14:01:53 -0500 Message-ID: <28694.1518721313@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ken Tanzer writes: > Something like a trigger on the table rename would be ideal for my > purposes. Anything like that possible? Thanks! Recent PG versions have "event triggers" which would serve the purpose. However, the infrastructure for them isn't very fully built out yet. I'm not sure if you could identify a table rename without resorting to writing some C code. regards, tom lane