PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -
i have been looking everywhere (google, stackoverflow, etc.) documentation on how use postgresql pg_read_binary_file()
function.
the meaningful thing can find this page in official documentation.
every time try use function error.
for example:
select pg_read_binary_file('/some/path/and/file.gif'); error: absolute path not allowed
or
select pg_read_binary_file('file.gif'); error: not stat file "file.gif": no such file or directory
do need have file in specific directory postgres have access it? if directory?
if matters, reason looking @ function because trying insert file database without doing crazy things.
as stated @a_horse_with_no_name , @guedes solution ensure file being uploaded on server in pgdata directory.
the postgres documentation state file location requirement.
additionally, made symlink directory pgdata directory not disturb of postgres data structure. seems working , don't have of above crazy things.
Comments
Post a Comment