PostgreSQL's PGP_SYM_ENCRYPT log security
You can change your configuration settings to make this less likely to occur (What setting was triggering the log message in the first place?)   

But in general, if you send your password to the database, then the database has your password. There is simply no way around this, other than not sending your password to the database and dealing with the consequences of that.  If you do send your password to the database, then you must guard the database log files with the same vigilance as you guard the rest of the database.