set role admin; select fresetmarket(); INFO: market_status OPENED->STOPPING CONTEXT: PL/pgSQL function "fresetmarket" line 7 at assignment INFO: The market is now stopping for clients CONTEXT: PL/pgSQL function "fresetmarket" line 7 at assignment NOTICE: truncate cascades to table "torder" CONTEXT: SQL statement "TRUNCATE towner CASCADE" PL/pgSQL function "fresetmarket_int" line 13 at SQL statement SQL statement "SELECT fresetmarket_int()" PL/pgSQL function "fresetmarket" line 9 at PERFORM NOTICE: truncate cascades to table "tmvt" CONTEXT: SQL statement "TRUNCATE towner CASCADE" PL/pgSQL function "fresetmarket_int" line 13 at SQL statement SQL statement "SELECT fresetmarket_int()" PL/pgSQL function "fresetmarket" line 9 at PERFORM NOTICE: truncate cascades to table "tmvtremoved" CONTEXT: SQL statement "TRUNCATE towner CASCADE" PL/pgSQL function "fresetmarket_int" line 13 at SQL statement SQL statement "SELECT fresetmarket_int()" PL/pgSQL function "fresetmarket" line 9 at PERFORM NOTICE: truncate cascades to table "treltried" CONTEXT: SQL statement "TRUNCATE tquality CASCADE" PL/pgSQL function "fresetmarket_int" line 14 at SQL statement SQL statement "SELECT fresetmarket_int()" PL/pgSQL function "fresetmarket" line 9 at PERFORM NOTICE: truncate cascades to table "torder" CONTEXT: SQL statement "TRUNCATE tquality CASCADE" PL/pgSQL function "fresetmarket_int" line 14 at SQL statement SQL statement "SELECT fresetmarket_int()" PL/pgSQL function "fresetmarket" line 9 at PERFORM NOTICE: truncate cascades to table "tmvt" CONTEXT: SQL statement "TRUNCATE tquality CASCADE" PL/pgSQL function "fresetmarket_int" line 14 at SQL statement SQL statement "SELECT fresetmarket_int()" PL/pgSQL function "fresetmarket" line 9 at PERFORM NOTICE: truncate cascades to table "tmvtremoved" CONTEXT: SQL statement "TRUNCATE tquality CASCADE" PL/pgSQL function "fresetmarket_int" line 14 at SQL statement SQL statement "SELECT fresetmarket_int()" PL/pgSQL function "fresetmarket" line 9 at PERFORM INFO: market_status STOPPING->CLOSED CONTEXT: PL/pgSQL function "fresetmarket" line 7 at assignment INFO: market_session = n->n+1 CONTEXT: PL/pgSQL function "fresetmarket" line 7 at assignment INFO: market_status CLOSED->STARTING CONTEXT: PL/pgSQL function "fresetmarket" line 7 at assignment INFO: Run the command: CONTEXT: PL/pgSQL function "fchangestatemarket" line 59 at assignment PL/pgSQL function "fresetmarket" line 7 at assignment INFO: VACUUM FULL ANALYZE CONTEXT: PL/pgSQL function "fchangestatemarket" line 59 at assignment PL/pgSQL function "fresetmarket" line 7 at assignment INFO: before starting the market CONTEXT: PL/pgSQL function "fchangestatemarket" line 59 at assignment PL/pgSQL function "fresetmarket" line 7 at assignment INFO: market_status STARTING->OPENED CONTEXT: PL/pgSQL function "fresetmarket" line 7 at assignment INFO: The market is now opened for clients CONTEXT: PL/pgSQL function "fresetmarket" line 7 at assignment INFO: The market is reset and opened fresetmarket -------------- (1 row) set role client; select finsertorder('u','b',1000,1000,'a'); INFO: owner u created CONTEXT: PL/pgSQL function "fgetowner" line 10 at assignment PL/pgSQL function "finsertorder" line 19 at assignment finsertorder ------------------------------ (1,1,2,1000,1,1000,0,0,{},,) (1 row) select finsertorder('v','c',1000,1000,'b'); INFO: owner v created CONTEXT: PL/pgSQL function "fgetowner" line 10 at assignment PL/pgSQL function "finsertorder" line 19 at assignment finsertorder ------------------------------ (2,2,1,1000,3,1000,0,0,{},,) (1 row) select qtt_in,qtt_out from fgetquote('w','a',1000,0,'c'); INFO: owner w created CONTEXT: PL/pgSQL function "fgetowner" line 10 at assignment PL/pgSQL function "fgetquote" line 36 at assignment qtt_in | qtt_out --------+--------- 1000 | 1000 (1 row) select finsertorder('w','a',1000,1000,'c'); finsertorder ---------------------------------------------------------------------------------------------------------------------------------------- (3,3,3,1000,2,1000,1000,1000,"{""[(1, 1, 2, 1000, 1, 1000, 1000),(2, 2, 1, 1000, 3, 1000, 1000),(3, 3, 3, 1000, 2, 1000, 1000)]""}",,) (1 row) select id,nb,oruuid,grp,provider,quality,qtt,receiver from vmvt; id | nb | oruuid | grp | provider | quality | qtt | receiver ----+----+--------+-----+----------+---------+------+---------- 2 | 3 | 2-1 | 1 | u | b | 1000 | v 3 | 3 | 2-2 | 1 | v | c | 1000 | w 1 | 3 | 2-3 | 1 | w | a | 1000 | u (3 rows) select fremoveagreement(1); fremoveagreement ------------------ 3 (1 row) select id,qtt from tquality; id | qtt ----+----- 1 | 0 2 | 0 3 | 0 (3 rows) select finsertorder('u','b',2000,1000,'a'); finsertorder ------------------------------ (4,1,2,1000,1,2000,0,0,{},,) (1 row) select finsertorder('v','c',2000,1000,'b'); finsertorder ------------------------------ (5,2,1,1000,3,2000,0,0,{},,) (1 row) select qtt_in,qtt_out from fgetquote('w','a',500,0,'c'); qtt_in | qtt_out --------+--------- 2000 | 500 (1 row) --select finsertorder('w','a',500,2000,'c'); select qtt_in,qtt_out from fgetquote('w','a',500,2000,'c'); qtt_in | qtt_out --------+--------- 2000 | 500 (1 row) select qtt_in,qtt_out from fexecquote('w',1); qtt_in | qtt_out --------+--------- 2000 | 500 (1 row) select id,nb,oruuid,grp,provider,quality,qtt,receiver from vmvt; id | nb | oruuid | grp | provider | quality | qtt | receiver ----+----+--------+-----+----------+---------+------+---------- 5 | 3 | 2-4 | 4 | u | b | 1000 | v 6 | 3 | 2-5 | 4 | v | c | 2000 | w 4 | 3 | 2-6 | 4 | w | a | 500 | u (3 rows) select fremoveagreement(4); fremoveagreement ------------------ 3 (1 row) select fgetquote('w','a',500,0,'b'); fgetquote ----------------------------------------------------------------------------------------------- (0,3,1,0,2,500,1000,500,"{""[(4, 1, 2, 1000, 1, 2000, 1000),(0, 3, 1, 0, 2, 500, 500)]""}",,) (1 row) select finsertorder('w','a',500,1000,'b'); finsertorder ----------------------------------------------------------------------------------------------------- (7,3,1,1000,2,500,1000,500,"{""[(4, 1, 2, 1000, 1, 2000, 1000),(7, 3, 1, 1000, 2, 500, 500)]""}",,) (1 row) set role admin; select * from fchangestatemarket(true); INFO: market_status OPENED->STOPPING INFO: The market is now stopping for clients fchangestatemarket -------------------- STOPPING (1 row) -- market is closed set role client; select fremoveagreement(7); fremoveagreement ------------------ 2 (1 row) set role admin; select id,qtt from tquality; id | qtt ----+----- 3 | 0 1 | 0 2 | 0 (3 rows) select * from fgetstats(true); _name | cnt -----------------------------+----- number of qualities | 3 number of owners | 3 number of quotes | 0 number of orders | 7 number of movements | 8 number of quotes removed | 1 number of orders removed | 7 number of movements removed | 8 number of agreements | 3 number of orders rejected | 0 agreements with 2 partners | 1 agreements with 3 partners | 2 (12 rows) select * from fgeterrs(true) where cnt != 0; _name | cnt -------+----- (0 rows) select * from fchangestatemarket(true); INFO: market_status STOPPING->CLOSED fchangestatemarket -------------------- CLOSED (1 row) select * from fchangestatemarket(true); INFO: market_session = n->n+1 INFO: market_status CLOSED->STARTING INFO: Run the command: CONTEXT: PL/pgSQL function "fchangestatemarket" line 59 at assignment INFO: VACUUM FULL ANALYZE CONTEXT: PL/pgSQL function "fchangestatemarket" line 59 at assignment INFO: before starting the market CONTEXT: PL/pgSQL function "fchangestatemarket" line 59 at assignment fchangestatemarket -------------------- STARTING (1 row) select * from fchangestatemarket(true); INFO: market_status STARTING->OPENED INFO: The market is now opened for clients fchangestatemarket -------------------- OPENED (1 row) -- merket is opened select * from fgetstats(true); _name | cnt -----------------------------+----- number of qualities | 0 number of owners | 0 number of quotes | 0 number of orders | 0 number of movements | 0 number of quotes removed | 0 number of orders removed | 0 number of movements removed | 0 number of agreements | 0 number of orders rejected | 0 (10 rows)