As I mentioned, Discourse comes with PostgreSQL, you don't need to install it.
The Bitnami stacks doesn't use the system's packages. That apt-get command doesn't modify the Bitnami installation at all, that's why you are getting the error after enabling the PHP's extension.
As I mentioned before, if you launched a Bitnami Discourse stack, it comes with PostgreSQL and the required extensions to connect to that database
$ php -m | grep pgsql
Can you confirm you are using the Bitnami Discourse stack or are you using a different one?
PS: If you have a Bitnami LAPP stack, you also have these extensions enabled by default.