From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Boris Makovecki" <boris(dot)makovecki(at)abak(dot)net> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: BUG #1455: pg_dumpall fails |
Date: | 2005-06-07 14:11:45 |
Message-ID: | 7927.1118153505@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
"Boris Makovecki" <boris(dot)makovecki(at)abak(dot)net> 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, "
From | Date | Subject | |
---|---|---|---|
Next Message | Frank van Vugt | 2005-06-07 16:06:32 | BUG in temp tables involving a temp table not properly hiding a regular table as well as allowing non-existent column names |
Previous Message | Tom Lane | 2005-06-07 03:10:21 | Re: [BUGS] BUG #1467: fe_connect doesn't handle EINTR right |