Skip site navigation (1) Skip section navigation (2)

user defined data type problem while dumping?

From: sarlav kumar <sarlavk(at)yahoo(dot)com>
To: pgsqlnovice <pgsql-novice(at)postgresql(dot)org>,pgsqlperform <pgsql-performance(at)postgresql(dot)org>
Subject: user defined data type problem while dumping?
Date: 2004-12-27 17:32:33
Message-ID: 20041227173233.98750.qmail@web51301.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novicepgsql-performance
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 

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2004-12-27 17:57:26
Subject: Re: user defined data type problem while dumping?
Previous:From: Keith WorthingtonDate: 2004-12-27 17:18:53
Subject: Re: Extracting data where a column is max

pgsql-performance by date

Next:From: Tom LaneDate: 2004-12-27 17:57:26
Subject: Re: user defined data type problem while dumping?
Previous:From: JeffDate: 2004-12-27 13:46:28
Subject: Re: Some Performance Advice Needed

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group