Re: lo_import
От | Patrick Nelson |
---|---|
Тема | Re: lo_import |
Дата | |
Msg-id | 4165C48DE9A0D211B6400800095C585F172E09@WASHINGTON обсуждение исходный текст |
Ответ на | lo_import (Patrick Nelson <pnelson@neatech.com>) |
Список | pgsql-general |
Cornelia Boenigk wrote: ----------------->>>> docgen=# CREATE TABLE fotos (name CHAR(15), bild OID); CREATE docgen=# INSERT INTO fotos VALUES docgen-# ('eule',lo_import('/home/conni/eule.gif')); INSERT 18999 1 docgen=# SELECT * FROM fotos; name | bild -------------------+---------- eule | 18999 (1 row) docgen=# SELECT lo_export(fotos.bild, '/tmp/euleout.gif') docgen-# FROM fotos WHERE name = 'eule'; lo_export ----------- 1 (1 row) docgen=# SELECT lo_unlink(fotos.bild) FROM fotos WHERE name = 'eule'; lo_unlink ----------- 1 (1 row) ----------------->>>> That works fine if your /home/conni/eule.gif is on the server, but what I was wanting was the process to insert when your on a remote system and your /home/conni/eule.gif is on the remote system not the server. You can use the \lo_import <filename> to import a local file to the server, which then can be seen with \lo_list and exported with \lo_export and then \lo_unlink if you wish. How do you put the OID into bild from the large objects list? I'm not sure what the use of \lo_<cmd> is?
В списке pgsql-general по дате отправления: