Is there a built-in stored procedure to do it, which can be called via SQL? I don’t believe a restart is possible in CircleCI with a secondary container.
If there is no stored proc/func to do it, you could move Postgres to your primary build container, and then you will have console access to restart it.