how to change owner of database in postgres code example Example: postgresql db owner change ALTER DATABASE target_database OWNER TO new_onwer;