lo_export and lo_import: paths and servers

Поиск
Список
Период
Сортировка
От Jorgen Austvik - Sun Norway
Тема lo_export and lo_import: paths and servers
Дата
Msg-id 474EB6A7.4090403@sun.com
обсуждение исходный текст
Ответы Re: lo_export and lo_import: paths and servers  (Jorgen Austvik - Sun Norway <Jorgen.Austvik@Sun.COM>)
Список 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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: pgwin32_open returning EINVAL
Следующее
От: Gregory Stark
Дата:
Сообщение: Re: Table inheritance, unique constraints and foreign key problem