Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id F24C91B763E1 for ; Mon, 14 May 2012 00:26:41 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1STlvl-0008Pu-3R for pgsql-bugs@postgresql.org; Mon, 14 May 2012 03:26:41 +0000 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 q4E3QSjM002619; Sun, 13 May 2012 23:26:28 -0400 (EDT) To: Thangalin cc: pgsql-bugs@postgresql.org Subject: Re: pg_dump: SQL command failed In-reply-to: References: Comments: In-reply-to Thangalin message dated "Sun, 13 May 2012 19:46:12 -0700" Date: Sun, 13 May 2012 23:26:27 -0400 Message-ID: <2618.1336965987@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/74 X-Sequence-Number: 33045 Thangalin writes: > 4. Dump the schema using pg_dump: > pg_dump -n *superschema* --inserts *superdatabase* > superduper.sql This does not dump the extension, because the extension is not within the schema "superschema". (It definitely isn't given your creation command, but pg_dump doesn't consider that extensions are inside schemas anyway, for the purposes of options such as "-n".) So on reload, the user function fails; it's referencing a function that doesn't exist in the new database. That's not a bug. BTW, the reason the unaccent function isn't marked immutable is that its behavior can be changed with ALTER TEXT DICTIONARY. This wrapper function doesn't eliminate that risk (in fact it adds some new ones), so it doesn't look very safe to me. regards, tom lane