code: def returner(ret):
      '''
      Return data to a Pg server
      '''
      try:
          with _get_serv(ret, commit=True) as cur:
              sql = '''INSERT INTO salt_returns
                      (fun, jid, return, id, success, full_ret, alter_time)
                      VALUES (%s, %s, %s, %s, %s, %s, to_timestamp(%s))'''
  
              cur.execute(sql, (ret['fun'], ret['jid'],
                                psycopg2.extras.Json(ret['return']),
                                ret['id'],
                                ret.get('success', False),
                                psycopg2.extras.Json(ret),
                                time.time()))
      except salt.exceptions.SaltMasterError:
          log.critical('Could not store return with pgjsonb returner. PostgreSQL server unavailable.'f returner(ret):
      '''
      Return data to a Pg server
      '''
      try:
          with _get_serv(ret, commit=True) as cur:
              sql = '''INSERT INTO salt_returns
                      (fun, jid, return, id, success, full_ret, alter_time)
                      VALUES (%s, %s, %s, %s, %s, %s, to_timestamp(%s))'''
  
              cur.execute(sql, (ret['fun'], ret['jid'],
                                psycopg2.extras.Json(ret['return']),
                                ret['id'],
                                ret.get('success', False),
                                psycopg2.extras.Json(ret),
                                time.time()))
      except salt.exceptions.SaltMasterError:
          log.critical('Could not store return with pgjsonb returner. PostgreSQL server unavailable.')
docs: Return data to a Pg server