lo_export and lo_import: paths and servers

From: Jorgen Austvik - Sun Norway <Jorgen(dot)Austvik(at)Sun(dot)COM>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: lo_export and lo_import: paths and servers
Date: 2007-11-29 12:55:03
Message-ID: 474EB6A7.4090403@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

The PostgreSQL 8.3 documentation[1] says this about lo_export and
lo_import paths and servers:

Import:

Note that the file is read by the client interface library, not by
the server; so it must exist in the client file system and be
readable by the client application.

Export:

Note that the file is written by the client interface library, not by
the server.

The way I read this is that both for lo_import and lo_export, the files
should be placed (and be readable) on the local file system for the client.

However, the behaviour I see when I run pg_regress and the large in
client/server mode over two different hosts, is that pg_export works
against the server file system (the file is written there), while
pg_import work against the client file system (the file is not there
when it tries to read it), leading to the result below.

Problem between keyboard and chair, in doc, libpq, psql or elsewhere?

-----8<------------------8<------------------8<------------------8<------------------8<----
SELECT lo_export(loid,
'/export/home/tmp/jagtmp/ja155679pgRegress/install/share/regress/results/lotest.txt')
FROM lotest_stash_values;
lo_export
-----------
1
(1 row)

\lo_import
'/export/home/tmp/jagtmp/ja155679pgRegress/install/share/regress/results/lotest.txt'
could not open file
"/export/home/tmp/jagtmp/ja155679pgRegress/install/share/regress/results/lotest.txt":
No such file or directory
\set newloid :LASTOID
-- just make sure \lo_export does not barf
\lo_export :newloid
'/export/home/tmp/jagtmp/ja155679pgRegress/install/share/regress/results/lotest2.txt'
ERROR: large object 0 does not exist
-----8<------------------8<------------------8<------------------8<------------------8<----

[1] http://www.postgresql.org/docs/8.3/static/lo-interfaces.html

-J
--

Jørgen Austvik, Software Engineering - QA
Sun Microsystems Database Technology Group

Attachment Content-Type Size
jorgen.austvik.vcf text/x-vcard 391 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-11-29 13:06:36 Re: Table inheritance, unique constraints and foreign key problem
Previous Message Magnus Hagander 2007-11-29 12:52:32 Re: pgwin32_open returning EINVAL