Temporary files
Certain query operations such as sort or hash table require some memory facility. This memory is provided by a runtime c...
For further actions, you may consider blocking this person and/or reporting abuse
path ~ ('PG_' || substring(current_setting('server_version') FROM '^(?:\d.\d\d?|\d+)'))
what exactly is this part doing in the query especially FROM '^(?:\d.\d\d?|\d+)')??? query is failing with msg "ERROR: absolute path not allowed"
When you create a tablespace, a directory is created in format
PG_server_version_some_other_digit.We check all tablespaces except
pg_globalfor temp files.I cannot figure where the error seems to be coming from currently but it seems to be related to tablespace setup.
Are you using tablespaces? And if so, can you confirm the setup of the tablespaces?
Thank you.
Anything wrong with the tablespace setup
Can you try break down the query? That way it would be easier to debug.
The first part
Btw, which version of PostgreSQL is it and is it native PostgreSQL?
One simple solution if resource are available is to create a ram based file system and use that for your temp file destination.
You mentioned that you avoided using "pg_ls_tmpdir" in the query since it's new as of PG12, but the query is using it. Is there an earlier version of the query that does not use it?
I ask because I'm trying to wrap my head around which queries are eating up my temp space, and due to the fact that I'm running Aurora PostgreSQL in AWS RDS, I cannot use "pg_ls_tmpdir" (the "rds_superuser" permissions explicitly deny it).
I started working with RDS recently but I didn't check out this issue until now. So using
pg_ls_tmpdiris indeed going to bypass the permission issue. I have now added a query which can be used on RDS, hopefully you find it useful. Cheers.Hi, I believe you mean
pg_ls_dirandpg_stat_file? Both functions are restricted to only superusers by default but execute can be granted to any user by a superuser.I am not totally conversant with
rds_superuserso you might not be able to call these functions.If the temporary file size is coming greater, please could you tell me how could I delete the temporary file in postgreSQL with the command?
Temporary files are cleaned up automatically once the queries using them are done processing or canceled. Deleting an in-use temporary files can lead to backend crashes or even server crashes.
Why do you want to delete the files? Are they stale/orphaned? You should only have orphaned/stale temporary files when there are crashes.