X-Original-To: pgsql-novice-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7B08E44E2D2 for ; Mon, 27 Dec 2004 17:32:53 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83958-03 for ; Mon, 27 Dec 2004 17:32:36 +0000 (GMT) Received: from web51301.mail.yahoo.com (web51301.mail.yahoo.com [206.190.38.167]) by svr1.postgresql.org (Postfix) with SMTP id DDFCB44E2E0 for ; Mon, 27 Dec 2004 17:32:34 +0000 (GMT) Received: (qmail 98752 invoked by uid 60001); 27 Dec 2004 17:32:33 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=ttOB86+wm5OzPF9LSS79cVz2pRfX54y+v2fYylxWe6pm3m2OpQLWClpT8bYsZoyjS5z4Kf/bx9EpQP01pJdjndkdFXJK4/OrHIsgdncb8lddIPsEl7+M2cfjBG/TOqzmJIawITFOpxu8n2Rb6srKTEgBfBkkOdqzyyzHEUWeUjs= ; Message-ID: <20041227173233.98750.qmail@web51301.mail.yahoo.com> Received: from [65.218.182.242] by web51301.mail.yahoo.com via HTTP; Mon, 27 Dec 2004 09:32:33 PST Date: Mon, 27 Dec 2004 09:32:33 -0800 (PST) From: sarlav kumar Subject: user defined data type problem while dumping? To: pgsqlnovice , pgsqlperform MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-486103204-1104168753=:97994" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.52 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, HTML_50_60, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200412/253 X-Sequence-Number: 11830 --0-486103204-1104168753=:97994 Content-Type: text/plain; charset=us-ascii 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 --0-486103204-1104168753=:97994 Content-Type: text/html; charset=us-ascii
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 --0-486103204-1104168753=:97994--