Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hzmfx-0004p9-Rg for pgsql-general@arkaria.postgresql.org; Mon, 19 Aug 2019 18:46:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hzmfw-00037H-Ff for pgsql-general@arkaria.postgresql.org; Mon, 19 Aug 2019 18:46:40 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hzmfw-00033T-3b for pgsql-general@lists.postgresql.org; Mon, 19 Aug 2019 18:46:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hzmfu-0002B5-0e for pgsql-general@lists.postgresql.org; Mon, 19 Aug 2019 18:46:39 +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 x7JIkYav005791; Mon, 19 Aug 2019 14:46:35 -0400 From: Tom Lane To: "Johann 'Myrkraverk' Oskarsson" cc: pgsql-general@lists.postgresql.org Subject: Re: Retroactively adding send and recv functions to a type? In-reply-to: References: <23029.1566235939@sss.pgh.pa.us> Comments: In-reply-to "Johann 'Myrkraverk' Oskarsson" message dated "Tue, 20 Aug 2019 01:46:14 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5789.1566240394.1@sss.pgh.pa.us> Date: Mon, 19 Aug 2019 14:46:34 -0400 Message-ID: <5790.1566240394@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "Johann 'Myrkraverk' Oskarsson" writes: > On Tue, Aug 20, 2019 at 1:32 AM Tom Lane wrote: >> You could manually update the pg_type row, and then if you were >> being fussy, add pg_depend entries showing the type depends on >> the functions. > Can I do this in a future proof way? That is, is there a way to make > that into an upgrade script, or will I make the extension > un-upgradable doing that? [ shrug... ] Depends what you consider "future proof". I should think that if pg_type.typsend goes away or changes meaning, for example, that would be reflective of changes large enough to break an extension dabbling in binary I/O in other ways anyway. Inserting new rows into pg_depend manually is a bit riskier, but I don't think that catalog has changed since its inception, so it's not all that risky. In any case, you could limit the lifespan of the upgrade script, if you roll it up into a new base install script ASAP. regards, tom lane