I have used
crypt() in one of my functions to hash user password. But what I observed the next day I started my pc that the same thing failed as cryptographic functions became unavailable upon restart. It showed message like functions
crypt() is unknown or not defined. I executed
create extension pgcrypto; once and it started working.
How to handle this in prod environment? Is there a way to make this module permanently available in db even if db is restarted?
Or do I have to instruct server manager to run this command in case they required to restart db server?
Or can I write this statement in functions itself so that it will create the extension every time before using cryptographic functions?
Moreover, we are using a read-replica of db, where it did not allowed to execute this "create extension" statement as there is read permission only. So how to make this cryptographic functions available in such read-only environment?