DEV Community

Discussion on: PostgreSQL temp files usage

 
bolajiwahab profile image
Bolaji Wahab

Okay. Can you run

SELECT pg_ls_dir('/nfs-mnt/postgres/tablespaces/omnia');
Enter fullscreen mode Exit fullscreen mode

This postgresql.org/docs/10/functions-a.... seems to be the issue but I believe you are using superuser.

Thread Thread
 
dineshparva profile image
dinesh reddy

Yes iam using postgres as login user

postgres=# SELECT pg_ls_dir('/nfs-mnt/postgres/tablespaces/omnia');
ERROR: absolute path not allowed
postgres=# \conninfo
You are connected to database "postgres" as user "postgres" via socket in "/var/run/postgresql" at port "5432".

Thread Thread
 
dineshparva profile image
dinesh reddy

looks like pg_ls_dir works only on postgresql datadirectory $PGDATA

postgres=# SELECT pg_ls_dir('/nfs-mnt/postgres/data/base');

pg_ls_dir

13457
1
147972689
13456
124079171
(5 rows)

postgres=# SELECT pg_ls_dir('/nfs-mnt/postgres/tablespaces/omnia');
ERROR: absolute path not allowed
postgres=#

Thread Thread
 
bolajiwahab profile image
Bolaji Wahab

Oh yeah. I just confirmed the functions were limited to only the cluster directory and log directory in 9.6, 10. And they were only changed to support files outside cluster directory later from 11.

Thread Thread
 
bolajiwahab profile image
Bolaji Wahab • Edited