def exec_pg_environ():
 env = os.environ.copy()
 if odoo.tools.config['db_host']:
  env['PGHOST'] = odoo.tools.config['db_host']
 if odoo.tools.config['db_port']:
  env['PGPORT'] = str(odoo.tools.config['db_port'])
 if odoo.tools.config['db_user']:
  env['PGUSER'] = odoo.tools.config['db_user']
 if odoo.tools.config['db_password']:
  env['PGPASSWORD'] = odoo.tools.config['db_password']
 return env

def exec_pg_environ ( ) : env = os . environ . copy ( ) if odoo . tools . config [ 'db_host' ] : env [ 'PGHOST' ] = odoo . tools . config [ 'db_host' ] if odoo . tools . config [ 'db_port' ] : env [ 'PGPORT' ] = str ( odoo . tools . config [ 'db_port' ] ) if odoo . tools . config [ 'db_user' ] : env [ 'PGUSER' ] = odoo . tools . config [ 'db_user' ] if odoo . tools . config [ 'db_password' ] : env [ 'PGPASSWORD' ] = odoo . tools . config [ 'db_password' ] return env
force the database postgresql environment variables to the database configuration of odoo .