lo_export and lo_import: paths and servers - Mailing list pgsql-hackers

From Jorgen Austvik - Sun Norway
Subject lo_export and lo_import: paths and servers
Date
Msg-id 474EB6A7.4090403@sun.com
Whole thread Raw
Responses Re: lo_export and lo_import: paths and servers  (Jorgen Austvik - Sun Norway <Jorgen.Austvik@Sun.COM>)
List 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

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: pgwin32_open returning EINVAL
Next
From: Gregory Stark
Date:
Subject: Re: Table inheritance, unique constraints and foreign key problem