6.1 pg_dump core dump
I have posted to the general news group but need a more definitive response.
I am running Postgresql 6.1 on SunOS 5.5.1. We are presently looking into
upgrading to Postgresql 6.3.2, but are having a problem with pg_dump core
dumping. It looks like the output is OK, but I would like to know for sure.
I read that pg_dump 6.2 should be able to dump a 6.1 database but can not
locate the 6.2 source to try it.
I have tried dumping my database with the pg_dumpall provided from the 6.3.2
tar file,but this also core dumps.
I have tried dumping the 6.1 database with 6.3.2 pg_dump, but get a user
authentication error.
I decided to debug the 6.1 pg_dump source and determined that the core dump
occured dumping tblinfo cleanup. Specifically when structures allocated for
sequence tables are being cleaned up. I made the following changes in the
getTables function.
for (i=0;i<ntups;i++) {
tblinfo[i].oid = strdup(PQgetvalue(res,i,i_oid));
tblinfo[i].relname = strdup(PQgetvalue(res,i,i_relname));
tblinfo[i].relarch = strdup(PQgetvalue(res,i,i_relarch));
tblinfo[i].relacl = strdup(PQgetvalue(res,i,i_relacl));
tblinfo[i].sequence = (strcmp (PQgetvalue(res,i,i_relkind), "S") == 0);
/* Local fix - needs to be initialized to zero for sequence tables.
*/
tblinfo[i].numatts = 0;
tblinfo[i].attlen = 0;
tblinfo[i].attlen = NULL;
tblinfo[i].inhAttrs = NULL;
tblinfo[i].attnames = NULL;
tblinfo[i].typnames = NULL;
}
I would like to know if my changes are appropriate, and how can I get the
correct patch if one is available. Any input would be appreciated. Thanks
in advance.
Chris Bower
Software Engineer
Eastman Kodak
bower@image.Kodak.COM (J Christopher Bower) writes:
I decided to debug the 6.1 pg_dump source and determined that the core dump
occured dumping tblinfo cleanup. Specifically when structures allocated for
sequence tables are being cleaned up.
It looks like this bug has been fixed in a different way in the current
pg_dump sources (clearTableInfo now knows that sequences don't have the
standard attributes). It also looks like pg_dump has changed enough
since 6.1 that any patches wouldn't be easily transferred back and
forth anyway.
You might be able to run the current pg_dump against your 6.1 database
by recompiling the current pg_dump.c/.h/common.c atop the 6.1 libpq.
That should cure the protocol incompatibility. However, pg_dump is
friendly enough with the system table layouts that I fear it might not
work with an old database anyway.
Probably your best bet is just to go ahead and use your patched pg_dump
to extract data from your old database.
regards, tom lane
Import Notes
Reply to msg id not found: YourmessageofMon27Jul1998113136-0400199807271531.LAA10550@coyote.image.Kodak.COM | Resolved by subject fallback
bower@image.Kodak.COM (J Christopher Bower) writes:
I decided to debug the 6.1 pg_dump source and determined that the core dump
occured dumping tblinfo cleanup. Specifically when structures allocated for
sequence tables are being cleaned up.
It looks like this bug has been fixed in a different way in the current
pg_dump sources (clearTableInfo now knows that sequences don't have the
standard attributes). It also looks like pg_dump has changed enough
since 6.1 that any patches wouldn't be easily transferred back and
forth anyway.
You might be able to run the current pg_dump against your 6.1 database
by recompiling the current pg_dump.c/.h/common.c atop the 6.1 libpq.
That should cure the protocol incompatibility. However, pg_dump is
friendly enough with the system table layouts that I fear it might not
work with an old database anyway.
Probably your best bet is just to go ahead and use your patched pg_dump
to extract data from your old database.
regards, tom lane
Tom,
Thanks for your help it looks like I'll proceed with my modified version
of pg_dump.
Compiling pg_dump 6.3.2 with the 6.1 libpq was successfull. This pg_dump
could connect to the database but failed when it attempted to perform a
select from pg_class in the 6.1 database and expected the attribute
relcheck. Apparently pg_class has been restructure somewhere between
6.1 and 6.3.2.
I'm confused because the documentation that I read indicates that the
6.3.2 pg_dump should be able to dump the 6.1 database. But appaently
this cannot be done, atleast with my 6.1 database.
Again thanks for your help.
Chris Bower
Import Notes
Resolved by subject fallback