Search code examples
postgresqlpgadmin

how can view data from refcursor in pgadmin postgresql


Im a new bies in postgresql and pgadmin. I have function and call it. The result like this

SELECT board_getallboardcontents(1,1,true,30,1,'KO',1,1,'2016-01-01','2019-06-30',0,false,false)

Result of data.

unnamed portal 3

unnamed portal 4

How can see data from

unnamed portal 3

unnamed portal 4


Solution

  • Within a transaction, you would call the stored procedure and retrieve the data from the cursor

    -- Start a transaction
    BEGIN;
    
      SELECT board_getallboardcontents(1,1,true,30,1,'KO',1,1,'2016-01-01','2019-06-30',0,false,false);
    
      FETCH ALL IN "<unnamed portal 3>";
      FETCH ALL IN "<unnamed portal 4>";
    COMMIT;
    

    This tutorial is relevant