Re: BUG #1455: pg_dumpall fails

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: BUG #1455: pg_dumpall fails

Tom Lane-2
"Boris Makovecki" <[hidden email]> writes:
> I'm trying to migrate postgre DB from 7.4 to 8.0. When I start pg_dumpall
> (8.0) and connect it to 7.4 it fails with error:

> pg_dump: SQL command failed
> pg_dump: Error message from server: ERROR:  cannot cast type "unknown" to
> text

I believe we have finally worked out an explanation for this failure:
you had a table named "text" and some functions in the same schema.
Due to some sloppy coding (probably mine :-() in 8.0 pg_dump, this
confused things.  Here is the patch if you still need it.

                        regards, tom lane

Index: pg_dump.c
===================================================================
RCS file: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v
retrieving revision 1.400.4.4
diff -c -r1.400.4.4 pg_dump.c
*** pg_dump.c 30 Apr 2005 08:19:44 -0000 1.400.4.4
--- pg_dump.c 7 Jun 2005 14:01:42 -0000
***************
*** 5115,5121 ****
  {
  appendPQExpBuffer(query,
   "SELECT proretset, prosrc, probin, "
!  "null::text as proargnames, "
   "provolatile, proisstrict, prosecdef, "
   "(SELECT lanname FROM pg_catalog.pg_language WHERE oid = prolang) as lanname "
   "FROM pg_catalog.pg_proc "
--- 5115,5121 ----
  {
  appendPQExpBuffer(query,
   "SELECT proretset, prosrc, probin, "
!  "null as proargnames, "
   "provolatile, proisstrict, prosecdef, "
   "(SELECT lanname FROM pg_catalog.pg_language WHERE oid = prolang) as lanname "
   "FROM pg_catalog.pg_proc "
***************
*** 5126,5132 ****
  {
  appendPQExpBuffer(query,
   "SELECT proretset, prosrc, probin, "
!  "null::text as proargnames, "
  "case when proiscachable then 'i' else 'v' end as provolatile, "
   "proisstrict, "
   "'f'::boolean as prosecdef, "
--- 5126,5132 ----
  {
  appendPQExpBuffer(query,
   "SELECT proretset, prosrc, probin, "
!  "null as proargnames, "
  "case when proiscachable then 'i' else 'v' end as provolatile, "
   "proisstrict, "
   "'f'::boolean as prosecdef, "
***************
*** 5139,5145 ****
  {
  appendPQExpBuffer(query,
   "SELECT proretset, prosrc, probin, "
!  "null::text as proargnames, "
  "case when proiscachable then 'i' else 'v' end as provolatile, "
   "'f'::boolean as proisstrict, "
   "'f'::boolean as prosecdef, "
--- 5139,5145 ----
  {
  appendPQExpBuffer(query,
   "SELECT proretset, prosrc, probin, "
!  "null as proargnames, "
  "case when proiscachable then 'i' else 'v' end as provolatile, "
   "'f'::boolean as proisstrict, "
   "'f'::boolean as prosecdef, "

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org