I’ve been following the (very sparse and cryptic) instructions here: https://www.postgresql.org/docs/12/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-CSVLOG
I’ve set up the
postgres_logtable exactly like it says on that page.
I’ve set up my
log_destination = ‘csvlog’
logging_collector = on
log_directory = ‘C:\pglogs’
log_filename = ‘PG_%Y-%m-%d_%H;%M;%S’
log_rotation_age = 1d
log_rotation_size = 0
log_truncate_on_rotation = on
I’ve restarted PostgreSQL, and it has created a
I am able to successfully run a
COPYquery to import the
PG_2020-09-20_00;56;19.csvinto my database table, if I explicitly name it.
- How am I supposed to determine which filename(s) to pick to COPY into the table from my automated, regularly run script? (Since it can’t be the "current" one.)
- After I have somehow determined which filename(s) are safe to COPY in, and I’ve loaded them into my table, am I expected to delete these myself?
- What’s with the plaintext-format
PG_2020-09-20_00;56;19file? Why is that created when I clearly tell PG to use CSV?
None of this is addressed on the page I linked to and which I’ve been following.