Home > Blockchain >  pg_ctlcluster with --log option
pg_ctlcluster with --log option

Time:03-12

https://askubuntu.com/questions/385416/pg-ctl-command-not-found-what-package-has-this-command/385970#385970 say that I should use pg_ctlcluster.

sudo pg_ctlcluster 14 main start is OK.

But the man page (https://manpages.ubuntu.com/manpages/trusty/man8/pg_ctlcluster.8.html) say that pg_ctlcluster can also use [pg_ctl options].
pg_ctlcluster [options] cluster-version cluster-name action -- [pg_ctl options]

So How do I use it also customize the log location. All the following command I've been tried all are failed.

sudo pg_ctlcluster 14 main start --l /home/jian/postgresql_lg/1.log
sudo pg_ctlcluster 14 main start -l /home/jian/postgresql_lg/1.log
sudo pg_ctlcluster 14 main stop --log /home/jian/postgresql_lg/1.log

The error almost the same: Unknown option: log Unknown option: l

CodePudding user response:

Something like this works.

 sudo pg_ctlcluster 12 main  start -- --log  /home/jian/postgresql_lg/1.log

But the directory needs to writable by the OS user who will be running PostgreSQL.

  • Related