Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 478EFB5DBDB for ; Mon, 16 May 2011 11:33:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 35133-05 for ; Mon, 16 May 2011 14:33:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id F0F07B5D94C for ; Mon, 16 May 2011 11:33:11 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p4GEX9YU015454; Mon, 16 May 2011 10:33:09 -0400 (EDT) To: Guillaume Lelarge cc: Wells Oliver , pgsql-admin@postgresql.org Subject: Re: Dump/restore casts In-reply-to: <4DD0E83D.2050805@lelarge.info> References: <4DD0E83D.2050805@lelarge.info> Comments: In-reply-to Guillaume Lelarge message dated "Mon, 16 May 2011 11:02:53 +0200" Date: Mon, 16 May 2011 10:33:09 -0400 Message-ID: <15453.1305556389@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201105/99 X-Sequence-Number: 37536 Guillaume Lelarge writes: > Le 05/12/2011 03:52 AM, Wells Oliver a écrit : >> If I'm understanding things, pg_dump will not dump casts b/c they are system >> objects and belong to neither schema nor database. > It doesn't dump system casts because they are system objects, and so > always available. But it does dump user casts. Of course the trick is to tell which is which. According to the pg_dump code the current rule is * As per discussion we dump casts if one or more of the underlying * objects (the conversion function and the two data types) are not * builtin AND if all of the non-builtin objects are included in the dump. * Builtin meaning, the namespace name does not start with "pg_". Possibly Oliver is falling foul of that rule somehow --- it's certainly not perfect, especially in a partial dump scenario. regards, tom lane