The OS and the PostgreSQL version of the old machine: FreeBSD 6.1-RELEASE & psql 8.1.3
And that of the new machine: FreeBSD 7.2-RELEASE & psql 8.4.0
(Using "uname -a" "psql -U pgsql" to check the version)
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;
ERROR: function public.system(cstring) does not exist
STATEMENT: ALTER FUNCTION public."system"(cstring) OWNER TO pgsql;
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;
The previous error was it could not find /lib/libc.so.6, so I installed the port misc/compat6x and copy the libc.so.6 to /lib. If I replaced libc.so.6 with libc.so.7, the same error occured.
I've did some googling. Should I insert the line
PG_MODULE_MAGIC;into the libc source code and recompile it? But I don't know where the code resides and what the command is.....
The above is about the first error, and for the second one I totally have no idea. Could somebody please help me out?
Thanks in advance.