¿Puedo ejecutar un trabajo cron como el usuario Postgres?

Tengo varias consultas que deben ejecutarse cada noche. Pensé que podría hacer lo siguiente:

cd /var/discourse
./launcher enter app
su postgres
crontab -e
... agregar mis tareas y guardar ...

pero obtengo un error:

postgres@EN-Discourse-Forums-app:~$ crontab -e
crontab: instalando nueva crontab
crontab: crontabs/postgres: rename: Operación no permitida
crontab: ediciones dejadas en /tmp/crontab.7kGYwA/crontab

¿Es esto posible?

The more “Discourse-way” of doing that would be creating a plugin with the queries as scheduled jobs.

Check this example:

Inside the execute block you can do anything, like this job who runs SQL:

Potentially, yes, but this doesn’t let others who may need to change the behavior of these queries and our servers use something they understand. It is very common to use CRON to run queries.

Did you read How to add a job to cron/anacron when creating Docker container ?