Re: Errors regarding transporting database using pg_dump

From: Chun-fan Ivan Liao <ivan(at)ivangelion(dot)tw>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Errors regarding transporting database using pg_dump
Date: 2009-10-05 17:36:04
Message-ID: 173f52ec0910051036l2f407121u6fe65371da465693@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you, Oosterhout and Lane.

The code is not written by me. The previous DB admin is not reachable.
I was just the present-stage DB (newbie) admin, and I never touched
PostgreSQL before.... :(

On Mon, Oct 5, 2009 at 10:34 PM, Martijn van Oosterhout
<kleptog(at)svana(dot)org> wrote:
>
> On Mon, Oct 05, 2009 at 06:07:44PM +0800, Chun-fan Ivan Liao wrote:
> > I used pg_dump to dump the old database out and psql to store the database
> > into the new server, but the following two errors occurred:
> >
> > ERROR:  incompatible library "/lib/libc.so.6": missing magic block
> > HINT:  Extension libraries are required to use the PG_MODULE_MAGIC macro.
> > STATEMENT:  CREATE FUNCTION "system"(cstring) RETURNS integer
> >             AS '/lib/libc.so.7', 'system'
> >             LANGUAGE c STRICT;
>
> Ok, here someone was cheating by invoking a system library function
> directly. That's no longer supported. If you really want this you need
> to make a small library with PG_MODULE_MAGIC; and a pg_system() function
> that redirects to the real system().
>
> That said, why are you doint this anyway. A better solution may be to
> install a trusted language (like plperlu or plpython) and do the system
> call from there.

Could you tell me the exact command I should use? Replace the error
command in the dumped file?

>
> > ERROR:  value too long for type character varying(12)
> > CONTEXT:  COPY stulist, line 46803, column STU_CNAME: "??????(9debacdd)???"
> > STATEMENT:  COPY stulist ("COURSE_SN", "S_YEAR", "S_TERM", "COU_CODE",
> > "CLASS", "REG_NO", "DPT_CODE", "DPT_SCNAME", "YEAR", "CREDIT", "COU_CNAME",
> > "TEA_CODE", "TEA_CNAME", "STU_CNAME", "SCORE", "SCORE_A", "SERNO", "PANOPA",
> > "UNIT", "TEMP") FROM stdin;
>
> Here the column is defined as 12 characters and you're trying to
> inserts a 19 character string, which is bad. How you got that out of
> pg_dump though I don't know.
>

I used pg_dump to dump the database again, and the statement and error
was the same also. No idea what to do.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message 233242661002 2009-10-05 17:36:47
Previous Message Greg Smith 2009-10-05 16:24:47 Re: Limit of bgwriter_lru_maxpages of max. 1000?