code: def ps(self):
          
  
          if self.is_pg_at_least_nine_two():
              idle = "AND state <> 'idle'"
          else:
              idle = "AND current_query <> '<IDLE>'"
  
          return self.execute(
              sql.PS.format(
                  pid_column=self.pid_column,
                  query_column=self.query_column,
                  idle=idle
              )
          )
docs: View active queries with execution time.
  
          Record(
              pid=28023,
              source='pgbench',
              running_for=datetime.timedelta(0, 0, 288174),
              waiting=0,
              query='UPDATE pgbench_accounts SET abalance = abalance + 423;'
          )
  
          :returns: list of Records