Performing cleanup tasks v17

The remove_log_file_and_job function performs cleanup tasks by removing the log files created by the schema cloning functions and the jobs created by the non-blocking functions.

remove_log_file_and_job (
  { <log_file> TEXT |
    <job_id> INTEGER |
    <log_file> TEXT, <job_id> INTEGER
  }
)

You can specify values for either or both of the two parameters when invoking the remove_log_file_and_job function:

  • If you specify only log_file, then the function removes only the log file.
  • If you specify only job_id, then the function removes only the job.
  • If you specify both, then the function removes only the log file and the job.

Parameters

log_file

Name of the log file to remove.

job_id

Job ID of the job to remove.

Example

This example removes only the log file, given the log file name:

edb=# SELECT edb_util.remove_log_file_and_job ('clone_edb_edbcopy');
Output
 remove_log_file_and_job
-------------------------
 t
(1 row)

This example removes only the job, given the job ID:

edb=# SELECT edb_util.remove_log_file_and_job (3);
Output
 remove_log_file_and_job
-------------------------
 t
(1 row)

This example removes the log file and the job, given both values:

tgtdb=# SELECT edb_util.remove_log_file_and_job ('clone_rmt_src_tgt',2);
Output
 remove_log_file_and_job
-------------------------
 t
(1 row)