Skip to content

"Get temporary file information for pg >= 12" adds noise when grepping for temporary files #442

@Krysztophe

Description

@Krysztophe

I usually search for temp file in postgresql.log with

grep "temporary file"  <logfile>

I think it's rather common.

Pg_activity pollutes my output (and other awk scripts base on that);

$ grep temporary /var/lib/postgresql/17/main/log/postgresql-2025-07-10_000000.log
2025-07-10 12:16:13.784 CEST [2352979]: [312-1] user=postgres,db=postgres,app=pg_activity,client=[local] LOG:  duration: 0.226 ms  statement: -- Get temporary file information for pg >= 12
2025-07-10 12:16:15.894 CEST [2352979]: [320-1] user=postgres,db=postgres,app=pg_activity,client=[local] LOG:  duration: 0.215 ms  statement: -- Get temporary file information for pg >= 12
2025-07-10 12:16:17.069 CEST [2351901]: [25-1] user=postgres,db=dalibotest,app=pg_restore,client=[local] LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp2351901.2.fileset/1.0", size 8192
2025-07-10 12:16:17.069 CEST [2351901]: [27-1] user=postgres,db=dalibotest,app=pg_restore,client=[local] LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp2351901.2.fileset/3.0", size 8192
2025-07-10 12:16:17.069 CEST [2351901]: [29-1] user=postgres,db=dalibotest,app=pg_restore,client=[local] LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp2351901.2.fileset/0.0", size 8192
2025-07-10 12:16:18.020 CEST [2352979]: [328-1] user=postgres,db=postgres,app=pg_activity,client=[local] LOG:  duration: 0.245 ms  statement: -- Get temporary file information for pg >= 12
2025-07-10 12:16:20.160 CEST [2352979]: [336-1] user=postgres,db=postgres,app=pg_activity,client=[local] LOG:  duration: 0.224 ms  statement: -- Get temporary file information for pg >= 12
2025-07-10 12:16:22.300 CEST [2352979]: [344-1] user=postgres,db=postgres,app=pg_activity,client=[local] LOG:  duration: 0.224 ms  statement: -- Get temporary file information for pg >= 12

OK, my regex could be more complex, but it would easy enough to modify the comment, eg 'Get temp file info' ?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions