在桌面PostgreSQL中使用pg_read_file读取文件 [英] using pg_read_file read file in desktop PostgreSQL
本文介绍了在桌面PostgreSQL中使用pg_read_file读取文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在 PostgreSQL 中使用 pg_read_file 在我的桌面上读取文件
pg_read_file(filename text [,offset bigint,length bigint])
我的查询
选择pg_read_file('/ root / desktop / new.txt',0,1000000);
错误
ERROR:绝对路径不允许
a href =http://stackoverflow.com/questions/22193303/postgresql-save-contents-in-lo-import-totable> UPDATE
如果您使用
psql
,您可以使用\lo_import
从本地文件创建一个大对象。
pg_read_file
工具只允许从服务器端文件读取。I wanted to how to read a file in my desk top using pg_read_file in PostgreSQL
pg_read_file(filename text [, offset bigint, length bigint])
my query
select pg_read_file('/root/desktop/new.txt' , 0 , 1000000);
error
ERROR: absolute path not allowed
解决方案If you're using
psql
you can use\lo_import
to create a large object from a local file.The
pg_read_file
tool only allows reads from server-side files.这篇关于在桌面PostgreSQL中使用pg_read_file读取文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文