using pg_read_file read file in desktop PostgreSQL

database, postgresql

Solution

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.

Problem

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 ``` UPDATE

Original source