Re: BUG #1089: pg_restore fails when restoring lo.sql functions from contrib

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #1089: pg_restore fails when restoring lo.sql functions from contrib
Дата
Msg-id 3922.1078262277@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #1089: pg_restore fails when restoring lo.sql functions from contrib  ("PostgreSQL Bugs List" <pgsql-bugs@postgresql.org>)
Список pgsql-bugs
"PostgreSQL Bugs List" <pgsql-bugs@postgresql.org> writes:
> Description:        pg_restore fails when restoring lo.sql functions from
> contrib

Hmm.  It looks like the code for dumping CREATE CAST fails if the cast
function is from a schema other than pg_catalog.  I'm amazed we did not
notice this when testing nearby fixes.  Anyway, here is the patch
against 7.4.*.

            regards, tom lane

Index: pg_dump.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/bin/pg_dump/pg_dump.c,v
retrieving revision 1.355.2.3
diff -c -r1.355.2.3 pg_dump.c
*** pg_dump.c    24 Feb 2004 03:35:45 -0000    1.355.2.3
--- pg_dump.c    2 Mar 2004 21:09:50 -0000
***************
*** 4083,4090 ****
          if (strcmp(castfunc, "0") == 0)
              appendPQExpBuffer(defqry, "WITHOUT FUNCTION");
          else
!             appendPQExpBuffer(defqry, "WITH FUNCTION %s",
!                           format_function_signature(&finfo[fidx], true));

          if (strcmp(castcontext, "a") == 0)
              appendPQExpBuffer(defqry, " AS ASSIGNMENT");
--- 4083,4098 ----
          if (strcmp(castfunc, "0") == 0)
              appendPQExpBuffer(defqry, "WITHOUT FUNCTION");
          else
!         {
!             /*
!              * Always qualify the function name, in case it is not in
!              * pg_catalog schema (format_function_signature won't qualify it).
!              */
!             appendPQExpBuffer(defqry, "WITH FUNCTION %s.",
!                               fmtId(finfo[fidx].pronamespace->nspname));
!             appendPQExpBuffer(defqry, "%s",
!                               format_function_signature(&finfo[fidx], true));
!         }

          if (strcmp(castcontext, "a") == 0)
              appendPQExpBuffer(defqry, " AS ASSIGNMENT");

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: BUG #1089: pg_restore fails when restoring lo.sql functions
Следующее
От: 帅猛
Дата:
Сообщение: 转发: docs on tsearch2