pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feeduser defined data type problem while dumping?
3+ messages / 3 participants
[nested] [flat]
* user defined data type problem while dumping?
@ 2004-12-27 17:32 sarlav kumar <sarlavk@yahoo.com>
2004-12-27 17:57 ` Re: user defined data type problem while dumping? Tom Lane <tgl@sss.pgh.pa.us>
2004-12-28 23:58 ` Re: [PERFORM] user defined data type problem while dumping? Alexander Borkowski <alexander.borkowski@abri.une.edu.au>
0 siblings, 2 replies; 3+ messages in thread
From: sarlav kumar @ 2004-12-27 17:32 UTC (permalink / raw)
To: pgsqlnovice <pgsql-novice@postgresql.org>; pgsql-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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: user defined data type problem while dumping?
2004-12-27 17:32 user defined data type problem while dumping? sarlav kumar <sarlavk@yahoo.com>
@ 2004-12-27 17:57 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2004-12-27 17:57 UTC (permalink / raw)
To: sarlav kumar <sarlavk@yahoo.com>; +Cc: pgsqlnovice <pgsql-novice@postgresql.org>
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [PERFORM] user defined data type problem while dumping?
2004-12-27 17:32 user defined data type problem while dumping? sarlav kumar <sarlavk@yahoo.com>
@ 2004-12-28 23:58 ` Alexander Borkowski <alexander.borkowski@abri.une.edu.au>
1 sibling, 0 replies; 3+ messages in thread
From: Alexander Borkowski @ 2004-12-28 23:58 UTC (permalink / raw)
To: sarlav kumar <sarlavk@yahoo.com>; +Cc: pgsql-novice@postgresql.org
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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2004-12-28 23:58 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-12-27 17:32 user defined data type problem while dumping? sarlav kumar <sarlavk@yahoo.com>
2004-12-27 17:57 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-12-28 23:58 ` Alexander Borkowski <alexander.borkowski@abri.une.edu.au>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox