I have a PostgREST instance deployed on Heroku using the buildpack.
The Postgres schemas are created by a Node.js program that uses node-pg-migrate.
After the migrations have run, the schema is changed and PostgREST needs to reload the schema to update its schema cache.
To refresh the cache without restarting the PostgREST server there's the option to send the server process a SIGHUP signal: killall -HUP postgrest
Since I have the migrations running from a Node.js program (npm run migrate:up
) it seems to make sense to send that signal with a post-migration script. I'm not even sure if I can send such a signal from another server to the PostgREST instance.
Basically, what I'm asking is how to send a SIGHUP signal to PostgREST on Heroku from a Node.js program on another server.