Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cEzag-0004mW-Gw for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Dec 2016 14:22:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cEzag-0003vU-07 for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Dec 2016 14:22:30 +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 1cEzaf-0003vE-7S for pgsql-hackers@postgresql.org; Thu, 08 Dec 2016 14:22:29 +0000 Received: from tamriel.snowman.net ([72.66.115.51]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cEzaT-0003wE-Rs for pgsql-hackers@postgresql.org; Thu, 08 Dec 2016 14:22:28 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 306C55F7AC; Thu, 8 Dec 2016 09:21:16 -0500 (EST) Date: Thu, 8 Dec 2016 09:21:16 -0500 From: Stephen Frost To: Tom Lane Cc: pgsql-hackers@postgresql.org Subject: Re: pg_dump vs. TRANSFORMs Message-ID: <20161208142116.GC23417@tamriel.snowman.net> References: <20160504183952.GE10850@tamriel.snowman.net> <20161207200915.GZ23417@tamriel.snowman.net> <729.1481151371@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="r21wuLfwIlf/vvzy" Content-Disposition: inline In-Reply-To: <729.1481151371@sss.pgh.pa.us> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-91-generic (x86_64) X-Uptime: 09:16:51 up 152 days, 15:41, 30 users, load average: 0.16, 0.10, 0.11 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -4.9 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --r21wuLfwIlf/vvzy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > As pointed out by Peter E, this also impacts CASTs. Attached is a patch > > which addresses both by simply also pulling any functions which are > > referenced from pg_cast or pg_transform when they have OIDs at or after > > FirstNormalObjectId. I also modified dumpCast() and dumpTransform() to > > complain loudly if they're unable to dump out the cast or transform due > > to not finding the function definition(s) necessary. >=20 > Please do not hack the already-overcomplicated query in getFuncs without > bothering to adjust the long comment that describes what it's doing. Right, just wanted to make sure no one had issue with this approach. > I have a vague feeling that the code for dumping casts and/or transforms > may have some assumptions that the underlying function is also being > dumped. Although maybe the assumption was really only what's fixed here, > ie that there be a DumpableObject for the function. Anyway, take a close > look for that. I'll look around and see, though my hunch is that, at some point, we were just pulling all functions and then an optimization was added to exclude pg_catalog and no one noticed that it broke casts using built-in functions. > Looks reasonable otherwise. Ok, great, I'll get to work on building and testing all supported versions of pg_dump vs. all server versions that I can reasonably get to build on my current laptop, which I expect to be a matrix of 9.2-master pg_dump against server versions ~7.4-master... Thanks! Stephen --r21wuLfwIlf/vvzy Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJYSWxbAAoJEO1sijiDR2RVzU8QAJTAHGbyueXU5T9g83QtzvHh Fr9c9GbsaP3izjLgwLlBAooV3BNORFwN4sVO86kGiuCuaymtdJ4qsEYRxDGknfxp VRNADi2BB/tHDBY+CwWPJa59RIb/ite6GeVN279JQ8BuspxFxxqEhLWiJU5T1yr9 qbv4A8PnO5yAYLaPTsDrHufA6Wz0zidAV9ep5hh2wx2XtT3o3N2k8ZgFDqTPFaEa ZYtg1eOPEhf7EAnCOzP7i7gEJEaKOca3G1SxsiW+NwEanVrru7AFzlNLdAjeTD10 4qFOqxcM3BrrTuJ2n3HZEHzjQtkUOa56JIxaHi1CCf/lYMj43Y7b/rELaq6/pCNl UBXhDZCGNmHWv3u8zdq9Vj+9QsD91dZh0llHZGoc+ymmMCUSDKXjcfudXutNBDuz H7qDaW4MDFmxjyxdP1ctfSu2b60V8HuOynGecDB/o1jo5b6bCyKUDC4+QJymheDE /RUOHSjMrFkLGg00PKB1joULp8raL/F+gfPBvBzdlj7MCWV5W90AdL6sqxXXio9Y hdpxumXYTH5VCtzGVbfFvbtB0m3L4WM9jwmG8wSK41DZisFM+KpZfemS2SjZ+xDa q9eLiNYpiCtdK6ev07SIBs9WlMvqLQjsRA4m8tCKtQMg/MT6WDTJsCUDOy8/cLLB At68Ht8Y0eMDBfFCJG4T =sq+o -----END PGP SIGNATURE----- --r21wuLfwIlf/vvzy--