This is a discussion on user defined data type problem while dumping? within the pgsql Novice forums, part of the PostgreSQL category; --> Hi All, I have a database running on Postgres 7.3.2. I am dumping the database schema from postgres 7.4.6 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi All, I have a database running on Postgres 7.3.2. I am dumping the database schema from postgres 7.4.6 to restore it on the new Postgres version. The two postgres versions are running on different machines. I did the dump and tried restoring it. I got an error message saying type "lo" is not defined yet. I reordered the list and moved the type definition and the functions using the type "lo" to the top, using pg_restore and tried restoring it again. These are the corresponding functions/types defined using the type "lo": SET SESSION AUTHORIZATION 'user';-- -- TOC entry 5 (OID 19114) -- Name: lo; Type: TYPE; Schema: public; Owner: user -- Data Pos: 0 -- CREATE TYPE lo ( INTERNALLENGTH = 4, INPUT = lo_in, OUTPUT = lo_out, DEFAULT = '-', ALIGNMENT = int4, STORAGE = plain ); SET SESSION AUTHORIZATION 'postgres'; -- -- TOC entry 851 (OID 19115) -- Name: lo_in(cstring); Type: FUNCTION; Schema: public; Owner: postgres -- Data Pos: 0 -- CREATE FUNCTION lo_in(cstring) RETURNS lo AS '/usr/local/pgsql/lib/contrib/lo.so', 'lo_in' LANGUAGE c; -- -- TOC entry 852 (OID 19116) -- Name: lo_out(lo); Type: FUNCTION; Schema: public; Owner: postgres -- Data Pos: 0 -- CREATE FUNCTION lo_out(lo) RETURNS cstring AS '/usr/local/pgsql/lib/contrib/lo.so', 'lo_out' LANGUAGE c; -- -- TOC entry 853 (OID 19117) -- Name: lo_manage(); Type: FUNCTION; Schema: public; Owner: postgres -- Data Pos: 0 -- CREATE FUNCTION lo_manage() RETURNS "trigger" AS '/usr/local/pgsql/lib/contrib/lo.so', 'lo_manage' LANGUAGE c; -- -- TOC entry 854 (OID 19129) -- Name: lo_oid(lo); Type: FUNCTION; Schema: public; Owner: postgres -- Data Pos: 0 -- CREATE FUNCTION lo_oid(lo) RETURNS oid AS '/usr/local/pgsql/lib/contrib/lo.so', 'lo_oid' LANGUAGE c; -- -- TOC entry 855 (OID 19130) -- Name: oid(lo); Type: FUNCTION; Schema: public; Owner: postgres -- Data Pos: 0 -- CREATE FUNCTION oid(lo) RETURNS oid AS '/usr/local/pgsql/lib/contrib/lo.so', 'lo_oid' LANGUAGE c; SET SESSION AUTHORIZATION 'user'; -- -- TOC entry 278 (OID 19119) -- Name: session; Type: TABLE; Schema: public; Owner: user -- Data Pos: 0 -- CREATE TABLE "session" ( session_id text NOT NULL, pid_owner integer DEFAULT 0, pid_pending integer DEFAULT 0, created timestamp with time zone DEFAULT now(), accessed timestamp with time zone DEFAULT now(), modified timestamp with time zone DEFAULT now(), uid integer, ip inet, browser character varying(200), params character varying(200), content lo ); I still get the following errors: psql:trialdump1:4364: NOTICE: type "lo" is not yet defined DETAIL: Creating a shell type definition. psql:trialdump1:4364: ERROR: could not access file "/usr/local/pgsql/lib/contrib/lo.so": No such file or directory psql:trialdump1:4374: ERROR: type lo does not exist psql:trialdump1:4391: ERROR: function lo_in(cstring) does not exist psql:trialdump1:4403: ERROR: could not access file "/usr/local/pgsql/lib/contrib/lo.so": No such file or directory psql:trialdump1:4425: ERROR: type "lo" does not exist psql:trialdump1:4437: ERROR: type lo does not exist psql:trialdump1:4447: ERROR: type lo does not exist psql:trialdump1:4460: ERROR: type "lo" does not exist psql:trialdump1:4472: ERROR: could not access file "/usr/lib/test_funcs.so": No such file or directory psql:trialdump1:7606: ERROR: relation "session" does not exist psql:trialdump1:10868: ERROR: relation "session" does not exist psql:trialdump1:13155: ERROR: relation "session" does not exist The session table uses type "lo" for one of it's columns and hence it does not get created. What could the problem be? Is it some sort of access rights problem with respect to the files it is not able to access? When I restored the dump after commenting out all tables/functions using the type "lo", everything works fine. It will be great if someone could throw light on this problem. Thanks, Saranya __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
| |||
| sarlav kumar <sarlavk@yahoo.com> writes: > I still get the following errors: > psql:trialdump1:4364: ERROR: could not access file "/usr/local/pgsql/lib/contrib/lo.so": No such file or directory Looks like you forgot to build the datatype's shared library on the new installation. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster |
| ||||
| Hi Saranya, > psql:trialdump1:4364: ERROR: could not access file "/usr/local/pgsql/lib/contrib/lo.so": No such file or directory > psql:trialdump1:4403: ERROR: could not access file "/usr/local/pgsql/lib/contrib/lo.so": No such file or directory It looks like you need to install the lo library on the machine you are trying to restore to. It contains the implementation for the type you are missing and it is not installed by default. You can find it in the contrib section of the PostgreSQL source tree. > psql:trialdump1:4472: ERROR: could not access file "/usr/lib/test_funcs.so": No such file or directory Don't know about this one, but this may be a similar problem (i.e. file exists on the machine you dumped from but not on the one you try to restore to). > What could the problem be? Is it some sort of access rights problem with respect to the files it is not able to access? If this was an access permission problem you would probably get 'Permission denied' instead of 'No such file or directory' in the error messages. HTH, Alex ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) |