<!DOCTYPE> <html> <head> <meta charset="utf-8" /> <title>PGWeb | API - %@0=5=85 40==KE</title> <style> body { font-size: 14px; font-family: sans-serif; padding: 0; margin: 0; } .root_title { padding: 10px; background: #326690; color: #fff; } .root_title b { font-size: 47px; } .lible { padding: 10px; border: solid 1px #cbf5ff; border-radius: 4px; color: #0c6080; } @media screen and (max-width: 800px) { .root_title span { display: none; } } .ctx { padding: 10px; } .lnk_root_title { color: #fff; text-decoration: none; } </style> <script src="/src/jquery-3.3.1.min.js"></script> </head> <body> <div class="root_title"><b><a class="lnk_root_title" href="/">PGWeb</a></b> <span>&minus; =51>;LH0O SQL-181;8>B5:0 4;O A>740=8O web-?@8;>65=89</span></div> <div class="ctx"> <style> pre { padding: 10px; background: #eee; overflow: auto; font-size: 14px; font-family: sans-serif; } .in[data-req=""] { font-style: italic; opacity: 0.4; } body, table { font-size: 14px; font-family: sans-serif; } .out, .in { display: inline-block; border-bottom: solid 1px; cursor: pointer; font-weight: bold; } .out { color: red; } .in { color: #47e647; } .in.active_key { color: #008800; } .out.active_key { color: #750303; } .td_func span:last-child { display: none; } .td_func { width: 40%; } .table_functions { border-collapse: collapse; } .table_functions tr td { border: solid 1px #eee; vertical-align: top; padding: 4px; } .table_functions tr:first-child td { font-weight: bold; } .table_exceptions { border-collapse: collapse; position: absolute; background: #fff; padding: 4px; width: 400px; display: none; } .table_exceptions tr td { border-color: #aaa; } .title_exceptions { display: inline-block; border-bottom: dotted 1px; color: red; cursor: pointer; font-weight: bold; } .exceptions_tr { background: #eee; } .example_warning { display: inline-block; color: #fff; margin-top: 10px; margin-left: 10px; background: #709080; padding: 4px; margin-bottom: 4px; border-radius: 2px; } </style> <h1>%@0=5=85 40==KE</h1> <div class="out" data-req="">KE>4=>5 7=0G5=85</div><br/> <div class="in" data-req="1">1O70B5;L=K9 ?0@0<5B@</div><br/> <div class="in" data-req="">5>1O70B5;L=K9 ?0@0<5B@</div><br/> <br/> <table class="table_functions"> <tr> <td>$C=:F8O</td> <td>?8A0=85</td> <td>@8<5@</td> </tr> <tr> <td class="td_func"><div class="out" data-key="node_id" title="ID =>4K">INT</div> <a href="#add_node0" name="add_node0">add_node</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="" title=" 07<5@ ?0@B8F89" data-key="partition_size">INT</div><span>,</span> <div class="in" data-req="" title="0==K5 =>4K" data-key="node_data">JSONB</div><span>,</span> )</td> <td> >102;5=85 =>4K. <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>DUPLICATE NODE NAME</b></td> <td>"0:>5 8<O =>4K C65 ACI5AB2C5B</td> </tr> <tr> <td><b>ERROR NODE NAME</b></td> <td>5?@028;L=>5 8<O =>4K</td> </tr> <tr> <td><b>ERROR PARTITION SIZE</b></td> <td>5?@028;L=K9 @07<5@ ?0@B8F88</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.add_node( 'site' );<br/> SELECT schema_docs.add_node( 'site', 20000 );<br/> SELECT schema_docs.add_node( 'site', 20000, '{"name":"site"}'::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="node_id" title="ID =>4K">INT</div> <a href="#add_node1" name="add_node1">add_node</a> ( <div class="in" data-req="1" title="CBL =>4K, 2 :>B>@CN 4>102;O5BAO" data-key="node_path">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="" title=" 07<5@ ?0@B8F89" data-key="partition_size">INT</div><span>,</span> <div class="in" data-req="" title="0==K5 =>4K" data-key="node_data">JSONB</div><span>,</span> )</td> <td> >102;5=85 =>4K 2 ACI5AB2CNICN =>4C. <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.add_node( 'site', 'news' );<br/> SELECT schema_docs.add_node( 'site/news', 'archive' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="node_id" title="ID =>4K">INT</div> <a href="#add_node2" name="add_node2">add_node</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="" title=" 07<5@ ?0@B8F89" data-key="partition_size">INT</div><span>,</span> <div class="in" data-req="" title="0==K5 =>4K" data-key="node_data">JSONB</div><span>,</span> )</td> <td> >102;5=85 =>4K 2 ACI5AB2CNICN =>4C. <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.add_node( 1, 'news' );<br/> SELECT schema_docs.add_node( 3, 'archive' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#rename_node3" name="rename_node3">rename_node</a> ( <div class="in" data-req="1" title="!B0@>5 8<O =>4K" data-key="old_node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title=">2>5 8<O =>4K" data-key="new_node_name">VARCHAR</div><span>,</span> )</td> <td> 5@58<5=>2K20=85 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>ERROR NODE NAME</b></td> <td>5?@028;L=>5 8<O =>4K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.rename_node( 'site', 'my_site' )</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#rename_node4" name="rename_node4">rename_node</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title=">2>5 8<O =>4K" data-key="new_node_name">VARCHAR</div><span>,</span> )</td> <td> 5@58<5=>2K20=85 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>ERROR NODE NAME</b></td> <td>5?@028;L=>5 8<O =>4K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.rename_node( 1, 'my_site' )</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#move_node5" name="move_node5">move_node</a> ( <div class="in" data-req="1" title="ID =>4K, :>B>@CN ?5@5<5I05<" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="ID =>4K, :C40 ?5@5<5I05<" data-key="node_id">INT</div><span>,</span> )</td> <td> 5@5<5I5=85 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>ERROR TARGET NODE</b></td> <td>5?@028;L=0O =>40 4;O ?5@5<5I5=8O</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.move_node( 2, 1 );<br/> <div class="example_warning">0 A0<K9 25@E=89 C@>25=L</div><br/> SELECT schema_docs.move_node( 2, 0 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#move_node6" name="move_node6">move_node</a> ( <div class="in" data-req="1" title="<O =>4K, :>B>@CN ?5@5<5I05<" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="<O =>4K, :C40 ?5@5<5I05<" data-key="node_name">VARCHAR</div><span>,</span> )</td> <td> 5@5<5I5=85 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>ERROR TARGET NODE</b></td> <td>5?@028;L=0O =>40 4;O ?5@5<5I5=8O</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.move_node( 'news', 'site' );<br/> <div class="example_warning">0 A0<K9 25@E=89 C@>25=L</div><br/> SELECT schema_docs.move_node( 'news', '' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#remove_node7" name="remove_node7">remove_node</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> )</td> <td> #40;5=85 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.remove_node( 'site' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#remove_node8" name="remove_node8">remove_node</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> )</td> <td> #40;5=85 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.remove_node( 1 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="node_table" title=""01;8F0 A 40==K<8 (id, pid, path, partition_size, count, index_id, index_name, schema, data)">TABLE</div> <a href="#get_nodes9" name="get_nodes9">get_nodes</a> ( )</td> <td> >;CG5=85 A?8A:0 =>4 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.get_nodes();</td> </tr> <tr> <td class="td_func"><div class="out" data-key="node_table" title=""01;8F0 A 40==K<8 (id, pid, path, partition_size, count, index_id, index_name, schema, data)">TABLE</div> <a href="#get_nodes10" name="get_nodes10">get_nodes</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> )</td> <td> >;CG5=85 A?8A:0 ?>4=>4 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.get_nodes( 1 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="node_table" title=""01;8F0 A 40==K<8 (id, pid, path, partition_size, count, index_id, index_name, schema, data)">TABLE</div> <a href="#get_nodes11" name="get_nodes11">get_nodes</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> )</td> <td> >;CG5=85 A?8A:0 ?>4=>4 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.get_nodes( 'site' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="node_table" title=""01;8F0 A 40==K<8 (id, pid, path, partition_size, count, index_id, index_name, schema, data)">TABLE</div> <a href="#get_node12" name="get_node12">get_node</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> )</td> <td> >;CG5=85 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.get_node( 1 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="node_table" title=""01;8F0 A 40==K<8 (id, pid, path, partition_size, count, index_id, index_name, schema, data)">TABLE</div> <a href="#get_node13" name="get_node13">get_node</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> )</td> <td> >;CG5=85 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.get_node( 'site' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#set_node_data14" name="set_node_data14">set_node_data</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="CBL" data-key="path_node_data">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="jsonb_node_data">JSONB</div><span>,</span> )</td> <td> #AB0=>2:0 40==KE 4;O =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>SAVE ERROR</b></td> <td>H81:0 A>E@0=5=8O</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.set_node_data( 1, 'name', '"Vasja"'::jsonb );<Br/> SELECT schema_docs.set_node_data( 1, 'info/age', '30'::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#set_node_data15" name="set_node_data15">set_node_data</a> ( <div class="in" data-req="1" title="CBL =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="CBL" data-key="path_node_data">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="jsonb_node_data">JSONB</div><span>,</span> )</td> <td> #AB0=>2:0 40==KE 4;O =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>SAVE ERROR</b></td> <td>H81:0 A>E@0=5=8O</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.set_node_data( 'users', 'name', '"Vasja"'::jsonb );<Br/> SELECT schema_docs.set_node_data( 'users/new', 'info/age', '30'::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#set_node_data16" name="set_node_data16">set_node_data</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="jsonb_node_data">JSONB</div><span>,</span> )</td> <td> #AB0=>2:0 40==KE 4;O =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>SAVE ERROR</b></td> <td>H81:0 A>E@0=5=8O</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.set_node_data( 1, '"Vasja"'::jsonb );<Br/> SELECT schema_docs.set_node_data( 1, '30'::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#set_node_data17" name="set_node_data17">set_node_data</a> ( <div class="in" data-req="1" title="CBL =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="jsonb_node_data">JSONB</div><span>,</span> )</td> <td> #AB0=>2:0 40==KE 4;O =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>SAVE ERROR</b></td> <td>H81:0 A>E@0=5=8O</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.set_node_data( 'users', '"Vasja"'::jsonb );<Br/> SELECT schema_docs.set_node_data( 'users/new', '30'::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="jsonb_node_data" title="0==K5">JSONB</div> <a href="#get_node_data18" name="get_node_data18">get_node_data</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="CBL" data-key="path_node_data">VARCHAR</div><span>,</span> )</td> <td> >;CG5=85 40==KE =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.get_node_data( 1, 'name' );<Br/> SELECT schema_docs.get_node_data( 1, 'info/age' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="jsonb_node_data" title="0==K5">JSONB</div> <a href="#get_node_data19" name="get_node_data19">get_node_data</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="CBL" data-key="path_node_data">VARCHAR</div><span>,</span> )</td> <td> >;CG5=85 40==KE =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.get_node_data( 'users', 'name' );<Br/> SELECT schema_docs.get_node_data( 'users/new', 'info/age' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="jsonb_node_data" title="0==K5">JSONB</div> <a href="#get_node_data20" name="get_node_data20">get_node_data</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> )</td> <td> >;CG5=85 40==KE =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.get_node_data( 1 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="jsonb_node_data" title="0==K5">JSONB</div> <a href="#get_node_data21" name="get_node_data21">get_node_data</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> )</td> <td> >;CG5=85 40==KE =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.get_node_data( 'users' );<Br/> SELECT schema_docs.get_node_data( 'users/new' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#remove_node_data22" name="remove_node_data22">remove_node_data</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="CBL" data-key="path_node_data">VARCHAR</div><span>,</span> )</td> <td> #40;5=85 40==KE =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.remove_node_data( 1, 'name' );<Br/> SELECT schema_docs.remove_node_data( 1. 'info/age' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#remove_node_data23" name="remove_node_data23">remove_node_data</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="CBL" data-key="path_node_data">VARCHAR</div><span>,</span> )</td> <td> #40;5=85 40==KE =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.remove_node_data( 'users', 'name' );<Br/> SELECT schema_docs.remove_node_data( 'users/new'. 'info/age' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#remove_node_data24" name="remove_node_data24">remove_node_data</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> )</td> <td> #40;5=85 40==KE =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.remove_node_data( 1 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#remove_node_data25" name="remove_node_data25">remove_node_data</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> )</td> <td> #40;5=85 40==KE =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.remove_node_data( 'users' );<Br/> SELECT schema_docs.remove_node_data( 'users/new' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="doc_id" title="ID 4>:C<5=B0">INT</div> <a href="#add_doc26" name="add_doc26">add_doc</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> )</td> <td> >102;5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NAME IS DUPLICATE</b></td> <td>"0:>5 8<O C65 ACI5AB2C5B</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.add_node( 1, '{}'::jsonb );<br/> SELECT schema_docs.add_node( 1, '{}'::jsonb, TRUE );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="doc_id" title="ID 4>:C<5=B0">INT</div> <a href="#add_doc27" name="add_doc27">add_doc</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> )</td> <td> >102;5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NAME IS DUPLICATE</b></td> <td>"0:>5 8<O C65 ACI5AB2C5B</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.add_node( 'site', '{}'::jsonb );<br/> SELECT schema_docs.add_node( 'site', '{}'::jsonb, TRUE );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="doc_id" title="ID 4>:C<5=B0">INT</div> <a href="#add_doc28" name="add_doc28">add_doc</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="<O 4>:C<5=B0" data-key="doc_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> )</td> <td> >102;5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NAME IS DUPLICATE</b></td> <td>"0:>5 8<O C65 ACI5AB2C5B</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.add_node( 1, 'doc', '{}'::jsonb );<br/> SELECT schema_docs.add_node( 1, 'doc', '{}'::jsonb, TRUE );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="doc_id" title="ID 4>:C<5=B0">INT</div> <a href="#add_doc29" name="add_doc29">add_doc</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="<O 4>:C<5=B0" data-key="doc_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> )</td> <td> >102;5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NAME IS DUPLICATE</b></td> <td>"0:>5 8<O C65 ACI5AB2C5B</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.add_node( 'site', 'doc', '{}'::jsonb );<br/> SELECT schema_docs.add_node( 'site', 'doc', '{}'::jsonb, TRUE );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#edit_doc30" name="edit_doc30">edit_doc</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="ID 4>:C<5=B0" data-key="doc_id">INT</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> <div class="in" data-req="" title=">=:0B5=8@CNI89 @568< (?> C<>;G0=8N TRUE)" data-key="concat_mode">BOOLEAN</div><span>,</span> )</td> <td> 7<5=5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>DOC NOT FOUND</b></td> <td>>:C<5=B0 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.edit_node( 1, 1, '{}'::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#edit_doc31" name="edit_doc31">edit_doc</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="<O 4>:C<5=B0" data-key="doc_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> <div class="in" data-req="" title=">=:0B5=8@CNI89 @568< (?> C<>;G0=8N TRUE)" data-key="concat_mode">BOOLEAN</div><span>,</span> )</td> <td> 7<5=5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>DOC NOT FOUND</b></td> <td>>:C<5=B0 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.edit_node( 1, 'doc', '{}'::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#edit_doc32" name="edit_doc32">edit_doc</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="ID 4>:C<5=B0" data-key="doc_id">INT</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> <div class="in" data-req="" title=">=:0B5=8@CNI89 @568< (?> C<>;G0=8N TRUE)" data-key="concat_mode">BOOLEAN</div><span>,</span> )</td> <td> 7<5=5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>DOC NOT FOUND</b></td> <td>>:C<5=B0 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.edit_node( 'site', 1, '{}'::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#edit_doc33" name="edit_doc33">edit_doc</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="<O 4>:C<5=B0" data-key="doc_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> <div class="in" data-req="" title=">=:0B5=8@CNI89 @568< (?> C<>;G0=8N TRUE)" data-key="concat_mode">BOOLEAN</div><span>,</span> )</td> <td> 7<5=5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>DOC NOT FOUND</b></td> <td>>:C<5=B0 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.edit_node( 'site', 'doc', '{}'::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#edit_doc34" name="edit_doc34">edit_doc</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="ID 4>:C<5=B0" data-key="doc_id">INT</div><span>,</span> <div class="in" data-req="1" title="CBL 40==KE" data-key="doc_path_data">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> <div class="in" data-req="" title=">=:0B5=8@CNI89 @568< (?> C<>;G0=8N TRUE)" data-key="concat_mode">BOOLEAN</div><span>,</span> )</td> <td> 7<5=5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>DOC NOT FOUND</b></td> <td>>:C<5=B0 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.edit_node( 1, 1, 'info/age', '30'::jsonb );<br/> <div class="example_warning">A;8 E>B8< C40;8BL 40==K5</div><br/> SELECT schema_docs.edit_node( 1, 1, 'info/age', null::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#edit_doc35" name="edit_doc35">edit_doc</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="<O 4>:C<5=B0" data-key="doc_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="CBL 40==KE" data-key="doc_path_data">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> <div class="in" data-req="" title=">=:0B5=8@CNI89 @568< (?> C<>;G0=8N TRUE)" data-key="concat_mode">BOOLEAN</div><span>,</span> )</td> <td> 7<5=5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>DOC NOT FOUND</b></td> <td>>:C<5=B0 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.edit_node( 1, 'doc', 'info/age', '30'::jsonb );<br/> <div class="example_warning">A;8 E>B8< C40;8BL 40==K5</div><br/> SELECT schema_docs.edit_node( 1, 'doc', 'info/age', null::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#edit_doc36" name="edit_doc36">edit_doc</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="ID 4>:C<5=B0" data-key="doc_id">INT</div><span>,</span> <div class="in" data-req="1" title="CBL 40==KE" data-key="doc_path_data">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> <div class="in" data-req="" title=">=:0B5=8@CNI89 @568< (?> C<>;G0=8N TRUE)" data-key="concat_mode">BOOLEAN</div><span>,</span> )</td> <td> 7<5=5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>DOC NOT FOUND</b></td> <td>>:C<5=B0 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.edit_node( 'site', 1, 'info/age', '30'::jsonb );<br/> <div class="example_warning">A;8 E>B8< C40;8BL 40==K5</div><br/> SELECT schema_docs.edit_node( 'site', 1, 'info/age', null::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#edit_doc37" name="edit_doc37">edit_doc</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="<O 4>:C<5=B0" data-key="doc_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="CBL 40==KE" data-key="doc_path_data">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> <div class="in" data-req="" title=">=:0B5=8@CNI89 @568< (?> C<>;G0=8N TRUE)" data-key="concat_mode">BOOLEAN</div><span>,</span> )</td> <td> 7<5=5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>DOC NOT FOUND</b></td> <td>>:C<5=B0 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.edit_node( 'site', 'doc', 'info/age', '30'::jsonb );<br/> <div class="example_warning">A;8 E>B8< C40;8BL 40==K5</div><br/> SELECT schema_docs.edit_node( 'site', 'doc', 'info/age', null::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#edit_doc_array38" name="edit_doc_array38">edit_doc_array</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="ID 4>:C<5=B0" data-key="doc_id">INT</div><span>,</span> <div class="in" data-req="1" title="CBL : <0AA82C" data-key="doc_path_data_arr">VARCHAR</div><span>,</span> <div class="in" data-req="1" title=">78F8O M;5<5=B0" data-key="doc_pos_arr">INT</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> )</td> <td> 7<5=5=85 <0AA820 40==KE 2 4>:C<5=B5 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>DOC NOT FOUND</b></td> <td>>:C<5=B0 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>TARGET DATA IS NOT ARRAY</b></td> <td>0==K5 =5 O2;ONBAO <0AA82><</td> </tr> <tr> <td><b>ERROR POSITION</b></td> <td>5?@028;L=0O ?>78F8O</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.edit_node( 1, 1, 'sessions', 0, '30'::jsonb );<br/> <div class="example_warning">A;8 E>B8< C40;8BL 40==K5</div><br/> SELECT schema_docs.edit_node( 1, 1, 'sessions', 0, null::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#edit_doc_array39" name="edit_doc_array39">edit_doc_array</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="<O 4>:C<5=B0" data-key="doc_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="CBL : <0AA82C" data-key="doc_path_data_arr">VARCHAR</div><span>,</span> <div class="in" data-req="1" title=">78F8O M;5<5=B0" data-key="doc_pos_arr">INT</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> )</td> <td> 7<5=5=85 <0AA820 40==KE 2 4>:C<5=B5 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>DOC NOT FOUND</b></td> <td>>:C<5=B0 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>TARGET DATA IS NOT ARRAY</b></td> <td>0==K5 =5 O2;ONBAO <0AA82><</td> </tr> <tr> <td><b>ERROR POSITION</b></td> <td>5?@028;L=0O ?>78F8O</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.edit_node( 1, 'doc', 'sessions', 0, '30'::jsonb );<br/> <div class="example_warning">A;8 E>B8< C40;8BL 40==K5</div><br/> SELECT schema_docs.edit_node( 1, 'doc', 'sessions', 0, null::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#edit_doc_array40" name="edit_doc_array40">edit_doc_array</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="ID 4>:C<5=B0" data-key="doc_id">INT</div><span>,</span> <div class="in" data-req="1" title="CBL : <0AA82C" data-key="doc_path_data_arr">VARCHAR</div><span>,</span> <div class="in" data-req="1" title=">78F8O M;5<5=B0" data-key="doc_pos_arr">INT</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> )</td> <td> 7<5=5=85 <0AA820 40==KE 2 4>:C<5=B5 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>DOC NOT FOUND</b></td> <td>>:C<5=B0 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>TARGET DATA IS NOT ARRAY</b></td> <td>0==K5 =5 O2;ONBAO <0AA82><</td> </tr> <tr> <td><b>ERROR POSITION</b></td> <td>5?@028;L=0O ?>78F8O</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.edit_node( 'site', 1, 'sessions', 0, '30'::jsonb );<br/> <div class="example_warning">A;8 E>B8< C40;8BL 40==K5</div><br/> SELECT schema_docs.edit_node( 'site', 1, 'sessions', 0, null::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#edit_doc_array41" name="edit_doc_array41">edit_doc_array</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="<O 4>:C<5=B0" data-key="doc_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="CBL : <0AA82C" data-key="doc_path_data_arr">VARCHAR</div><span>,</span> <div class="in" data-req="1" title=">78F8O M;5<5=B0" data-key="doc_pos_arr">INT</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="doc_data">JSONB</div><span>,</span> <div class="in" data-req="" title="5B0;L=0O 20;840F8O (?> C<>;G0=8N FALSE)" data-key="detail_valid">BOOLEAN</div><span>,</span> )</td> <td> 7<5=5=85 <0AA820 40==KE 2 4>:C<5=B5 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>DOC NOT FOUND</b></td> <td>>:C<5=B0 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>TARGET DATA IS NOT ARRAY</b></td> <td>0==K5 =5 O2;ONBAO <0AA82><</td> </tr> <tr> <td><b>ERROR POSITION</b></td> <td>5?@028;L=0O ?>78F8O</td> </tr> <tr> <td><b>DATA IS BAD</b></td> <td>5?@028;L=K5 40==K5</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.edit_node( 'site', 'doc', 'sessions', 0, '30'::jsonb );<br/> <div class="example_warning">A;8 E>B8< C40;8BL 40==K5</div><br/> SELECT schema_docs.edit_node( 'site', 'doc', 'sessions', 0, null::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#remove_doc42" name="remove_doc42">remove_doc</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="ID 4>:C<5=B0" data-key="doc_id">INT</div><span>,</span> )</td> <td> #40;5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.remove_doc( 1, 1 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#remove_doc43" name="remove_doc43">remove_doc</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="<O 4>:C<5=B0" data-key="doc_name">VARCHAR</div><span>,</span> )</td> <td> #40;5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.remove_doc( 1, 'doc' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#remove_doc44" name="remove_doc44">remove_doc</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="ID 4>:C<5=B0" data-key="doc_id">INT</div><span>,</span> )</td> <td> #40;5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.remove_doc( 'site', 1 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#remove_doc45" name="remove_doc45">remove_doc</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="<O 4>:C<5=B0" data-key="doc_name">VARCHAR</div><span>,</span> )</td> <td> #40;5=85 4>:C<5=B0 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.remove_doc( 'site', 'doc' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#set_node_partition_limit46" name="set_node_partition_limit46">set_node_partition_limit</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title=" 07<5@ ?0@B8F88" data-key="partition_size">INT</div><span>,</span> )</td> <td> #AB0=>2:0 @07<5@0 ?0@B8F88 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.set_node_partition_limit( 1, 50000 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#set_node_partition_limit47" name="set_node_partition_limit47">set_node_partition_limit</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title=" 07<5@ ?0@B8F88" data-key="partition_size">INT</div><span>,</span> )</td> <td> #AB0=>2:0 @07<5@0 ?0@B8F88 <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.set_node_partition_limit( 'site', 50000 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#create_node_index_id48" name="create_node_index_id48">create_node_index_id</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> )</td> <td> !>740=85 8=45:A0 ?> ID 4>:C<5=B>2 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.create_node_index_id( 1 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#create_node_index_id49" name="create_node_index_id49">create_node_index_id</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> )</td> <td> !>740=85 8=45:A0 ?> ID 4>:C<5=B>2 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.create_node_index_id( 'site' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#create_node_index_name50" name="create_node_index_name50">create_node_index_name</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> )</td> <td> !>740=85 8=45:A0 ?> 8<5=0< 4>:C<5=B>2 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.create_node_index_name( 1 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#create_node_index_name51" name="create_node_index_name51">create_node_index_name</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> )</td> <td> !>740=85 8=45:A0 ?> 8<5=0< 4>:C<5=B>2 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.create_node_index_name( 'site' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#drop_node_index_id52" name="drop_node_index_id52">drop_node_index_id</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> )</td> <td> #40;5=85 8=45:A0 ?> ID 4>:C<5=B>2 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.drop_node_index_id( 1 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#drop_node_index_id53" name="drop_node_index_id53">drop_node_index_id</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> )</td> <td> #40;5=85 8=45:A0 ?> ID 4>:C<5=B>2 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.drop_node_index_id( 'site' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#drop_node_index_name54" name="drop_node_index_name54">drop_node_index_name</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> )</td> <td> #40;5=85 8=45:A0 ?> 8<5=0< 4>:C<5=B>2 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.drop_node_index_name( 1 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#drop_node_index_name55" name="drop_node_index_name55">drop_node_index_name</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> )</td> <td> #40;5=85 8=45:A0 ?> 8<5=0< 4>:C<5=B>2 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.drop_node_index_name( 'site' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#create_node_index56" name="create_node_index56">create_node_index</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="CBL : 40==K<" data-key="path_index">VARCHAR</div><span>,</span> <div class="in" data-req="" title=""8? 8=45:A0 ('GIN' 8;8 NULL, ?> C<>;G0=8N NULL)" data-key="type_index">VARCHAR</div><span>,</span> )</td> <td> !>740=85 8=45:A0 ?> 4>:C<5=B0< 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>DUPLICATE INDEX</b></td> <td>=45:A C65 ACI5AB2C5B</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.create_node_index( 1, 'info/age' );<br/> SELECT schema_docs.create_node_index( 1, 'info/age', 'gin' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#create_node_index57" name="create_node_index57">create_node_index</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="CBL : 40==K<" data-key="path_index">VARCHAR</div><span>,</span> <div class="in" data-req="" title=""8? 8=45:A0 ('GIN' 8;8 NULL, ?> C<>;G0=8N NULL)" data-key="type_index">VARCHAR</div><span>,</span> )</td> <td> !>740=85 8=45:A0 ?> 4>:C<5=B0< 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>DUPLICATE INDEX</b></td> <td>=45:A C65 ACI5AB2C5B</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.create_node_index( 'site', 'info/age' );<br/> SELECT schema_docs.create_node_index( 'site', 'info/age', 'gin' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#drop_node_index58" name="drop_node_index58">drop_node_index</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="CBL : 40==K<" data-key="path_index">VARCHAR</div><span>,</span> <div class="in" data-req="" title=""8? 8=45:A0 ('GIN' 8;8 NULL, ?> C<>;G0=8N NULL)" data-key="type_index">VARCHAR</div><span>,</span> )</td> <td> #40;5=85 8=45:A0 ?> 4>:C<5=B0< 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>DUPLICATE INDEX</b></td> <td>=45:A C65 ACI5AB2C5B</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.drop_node_index( 1, 'info/age' );<br/> SELECT schema_docs.drop_node_index( 1, 'info/age', 'gin' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#drop_node_index59" name="drop_node_index59">drop_node_index</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="CBL : 40==K<" data-key="path_index">VARCHAR</div><span>,</span> <div class="in" data-req="" title=""8? 8=45:A0 ('GIN' 8;8 NULL, ?> C<>;G0=8N NULL)" data-key="type_index">VARCHAR</div><span>,</span> )</td> <td> #40;5=85 8=45:A0 ?> 4>:C<5=B0< 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>DUPLICATE INDEX</b></td> <td>=45:A C65 ACI5AB2C5B</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.drop_node_index( 'site', 'info/age' );<br/> SELECT schema_docs.drop_node_index( 'site', 'info/age', 'gin' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="table_indexes" title=""01;8F0 (path, type_index)">TABLE</div> <a href="#get_node_indexes60" name="get_node_indexes60">get_node_indexes</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> )</td> <td> >;CG5=85 8=45:A>2 ?> 4>:C<5=B0< 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.get_node_indexes( 1 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="table_indexes" title=""01;8F0 (path, type_index)">TABLE</div> <a href="#get_node_indexes61" name="get_node_indexes61">get_node_indexes</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> )</td> <td> >;CG5=85 8=45:A>2 ?> 4>:C<5=B0< 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.get_node_indexes( 'site' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#node_set_schema62" name="node_set_schema62">node_set_schema</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="!E5<0" data-key="data_schema">JSONB</div><span>,</span> )</td> <td> #AB0=>2:0 AE5<K =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>ERR FORMAT</b></td> <td>5?@028;L=K9 D>@<0B</td> </tr> <tr> <td><b>ERR NAME TYPE</b></td> <td>5?@028;L=>5 8<O B8?0</td> </tr> <tr> <td><b>NO NAME</b></td> <td>5 C:070=> 8<O</td> </tr> <tr> <td><b>ERR REQUIRED TYPE</b></td> <td>required 4>;65= 1KBL B8?0 BOOLEAN</td> </tr> <tr> <td><b>ERR DATA TYPE</b></td> <td>5?@028;L=K9 B8? data, C >1J5:B>2 B>;L:> <0AA82, C <0AA82>2 B>;L:> >1J5:B</td> </tr> <tr> <td><b>ERR MINCOUNT LESS ZERO</b></td> <td>8=8<0;L=>5 :>;8G5AB2> M;5<5=B>2 <0AA820 <5=LH5 0</td> </tr> <tr> <td><b>ERR MINCOUNT TYPE</b></td> <td>8=8<0;L=>5 :>;8G5AB2> M;5<5=B>2 <0AA820 4>;6=> 1KBL F8D@>9</td> </tr> <tr> <td><b>ERR MAXCOUNT LESS ZERO</b></td> <td>0:A8<0;L=>5 :>;8G5AB2> M;5<5=B>2 <0AA820 <5=LH5 0</td> </tr> <tr> <td><b>ERR MAXCOUNT TYPE</b></td> <td>0:A8<0;L=>5 :>;8G5AB2> M;5<5=B>2 <0AA820 4>;6=> 1KBL F8D@>9</td> </tr> <tr> <td><b>ERR MINCOUNT MAXCOUNT</b></td> <td>8=8<0;L=>5 :>;8G5AB2> M;5<5=B>2 <0AA820 1>;LH5 <0:A8<0;L=>3></td> </tr> <tr> <td><b>ERR MIN TYPE</b></td> <td>8=8<0;L=>5 7=0G5=85 4>;6=> 1KBL F8D@>9</td> </tr> <tr> <td><b>ERR MAX TYPE</b></td> <td>0:A8<0;L=>5 7=0G5=85 4>;6=> 1KBL F8D@>9</td> </tr> <tr> <td><b>ERR MIN MAX</b></td> <td>8=8<0;L=>5 7=0G5=85 1>;LH5 <0:A8<0;L=>3></td> </tr> <tr> <td><b>ERR MINLENGTH LESS ZERO</b></td> <td>8=8<0;L=0O 4;8=0 AB@>:8 <5=LH5 0</td> </tr> <tr> <td><b>ERR MINLENGTH TYPE</b></td> <td>8=8<0;L=0O 4;8=0 AB@>:8 4>;6=0 1KBL F8D@>9</td> </tr> <tr> <td><b>ERR MAXLENGTH LESS ZERO</b></td> <td>0:A8<0;L=0O 4;8=0 AB@>:8 <5=LH5 0</td> </tr> <tr> <td><b>ERR MAXLENGTH TYPE</b></td> <td>0:A8<0;L=0O 4;8=0 AB@>:8 4>;6=0 1KBL F8D@>9</td> </tr> <tr> <td><b>ERR MINLENGTH MAXLENGTH</b></td> <td>8=8<0;L=0O 4;8=0 AB@>:8 1>;LH5 <0:A8<0;L=>9</td> </tr> <tr> <td><b>ERR REGEXP TYPE</b></td> <td> 53C;O@=>5 2K@065=85 4>;6=> 1KBL AB@>:>9</td> </tr> <tr> <td><b>TYPE UNKNOWN</b></td> <td>58725AB=K9 B8?</td> </tr> <tr> <td><b>TYPE IS NOT STRING</b></td> <td>"8? =5 O2;O5BAO AB@>:>9</td> </tr> <tr> <td><b>NO TYPE</b></td> <td>5 C:070= B8?</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.node_set_schema( 1, '{"type":"string"}'::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#node_set_schema63" name="node_set_schema63">node_set_schema</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="!E5<0" data-key="data_schema">JSONB</div><span>,</span> )</td> <td> #AB0=>2:0 AE5<K =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>ERR FORMAT</b></td> <td>5?@028;L=K9 D>@<0B</td> </tr> <tr> <td><b>ERR NAME TYPE</b></td> <td>5?@028;L=>5 8<O B8?0</td> </tr> <tr> <td><b>NO NAME</b></td> <td>5 C:070=> 8<O</td> </tr> <tr> <td><b>ERR REQUIRED TYPE</b></td> <td>required 4>;65= 1KBL B8?0 BOOLEAN</td> </tr> <tr> <td><b>ERR DATA TYPE</b></td> <td>5?@028;L=K9 B8? data, C >1J5:B>2 B>;L:> <0AA82, C <0AA82>2 B>;L:> >1J5:B</td> </tr> <tr> <td><b>ERR MINCOUNT LESS ZERO</b></td> <td>8=8<0;L=>5 :>;8G5AB2> M;5<5=B>2 <0AA820 <5=LH5 0</td> </tr> <tr> <td><b>ERR MINCOUNT TYPE</b></td> <td>8=8<0;L=>5 :>;8G5AB2> M;5<5=B>2 <0AA820 4>;6=> 1KBL F8D@>9</td> </tr> <tr> <td><b>ERR MAXCOUNT LESS ZERO</b></td> <td>0:A8<0;L=>5 :>;8G5AB2> M;5<5=B>2 <0AA820 <5=LH5 0</td> </tr> <tr> <td><b>ERR MAXCOUNT TYPE</b></td> <td>0:A8<0;L=>5 :>;8G5AB2> M;5<5=B>2 <0AA820 4>;6=> 1KBL F8D@>9</td> </tr> <tr> <td><b>ERR MINCOUNT MAXCOUNT</b></td> <td>8=8<0;L=>5 :>;8G5AB2> M;5<5=B>2 <0AA820 1>;LH5 <0:A8<0;L=>3></td> </tr> <tr> <td><b>ERR MIN TYPE</b></td> <td>8=8<0;L=>5 7=0G5=85 4>;6=> 1KBL F8D@>9</td> </tr> <tr> <td><b>ERR MAX TYPE</b></td> <td>0:A8<0;L=>5 7=0G5=85 4>;6=> 1KBL F8D@>9</td> </tr> <tr> <td><b>ERR MIN MAX</b></td> <td>8=8<0;L=>5 7=0G5=85 1>;LH5 <0:A8<0;L=>3></td> </tr> <tr> <td><b>ERR MINLENGTH LESS ZERO</b></td> <td>8=8<0;L=0O 4;8=0 AB@>:8 <5=LH5 0</td> </tr> <tr> <td><b>ERR MINLENGTH TYPE</b></td> <td>8=8<0;L=0O 4;8=0 AB@>:8 4>;6=0 1KBL F8D@>9</td> </tr> <tr> <td><b>ERR MAXLENGTH LESS ZERO</b></td> <td>0:A8<0;L=0O 4;8=0 AB@>:8 <5=LH5 0</td> </tr> <tr> <td><b>ERR MAXLENGTH TYPE</b></td> <td>0:A8<0;L=0O 4;8=0 AB@>:8 4>;6=0 1KBL F8D@>9</td> </tr> <tr> <td><b>ERR MINLENGTH MAXLENGTH</b></td> <td>8=8<0;L=0O 4;8=0 AB@>:8 1>;LH5 <0:A8<0;L=>9</td> </tr> <tr> <td><b>ERR REGEXP TYPE</b></td> <td> 53C;O@=>5 2K@065=85 4>;6=> 1KBL AB@>:>9</td> </tr> <tr> <td><b>TYPE UNKNOWN</b></td> <td>58725AB=K9 B8?</td> </tr> <tr> <td><b>TYPE IS NOT STRING</b></td> <td>"8? =5 O2;O5BAO AB@>:>9</td> </tr> <tr> <td><b>NO TYPE</b></td> <td>5 C:070= B8?</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.node_set_schema( 'site', '{"type":"string"}'::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#add_field64" name="add_field64">add_field</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title=">2K9 ?CBL 40==KE" data-key="add_field_path">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="add_data">JSONB</div><span>,</span> )</td> <td> >102;5=85 =>2>3> ?>;O 2 4>:C<5=BK 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>PATH IS BAD</b></td> <td>5?@028;L=K9 ?CBL</td> </tr> <tr> <td><b>DATA IS NULL</b></td> <td>5;L7O 4>1028BL ?CAB>5 ?>;5</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.add_field( 1, 'info/name', '""'::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#add_field65" name="add_field65">add_field</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title=">2K9 ?CBL 40==KE" data-key="add_field_path">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="0==K5" data-key="add_data">JSONB</div><span>,</span> )</td> <td> >102;5=85 =>2>3> ?>;O 2 4>:C<5=BK 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>PATH IS BAD</b></td> <td>5?@028;L=K9 ?CBL</td> </tr> <tr> <td><b>DATA IS NULL</b></td> <td>5;L7O 4>1028BL ?CAB>5 ?>;5</td> </tr> <tr> <td><b>PATH NOT FOUND</b></td> <td>CB8 =5 ACI5AB2C5B</td> </tr> <tr> <td><b>ERROR TYPE</b></td> <td>H81>G=K9 B8?</td> </tr> <tr> <td><b>ERR TYPE NAME %</b></td> <td>H81>G=K9 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR NOT TYPE NAME %</b></td> <td>5ACI5AB2CNI89 B8? 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>NOT NAME %</b></td> <td>BACBAB2C5B ?0@0<5B@ 40==KE A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINCOUNT NAME %</b></td> <td>0AA82 <5=LH5 C:070==>3> <8=8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXCOUNT NAME %</b></td> <td>0AA82 1>;LH5 C:070==>3> <0:A8<0;L=>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MIN NAME %</b></td> <td>'8A;> <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAX NAME %</b></td> <td>'8A;> 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MAXLENGTH NAME %</b></td> <td>!B@>:0 1>;LH5 <0:A8<0;L=> 4>?CAB8<>3> C:070==>3> @07<5@0 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR MINLENGTH NAME %</b></td> <td>!B@>:0 <5=LH5 <8=8<0;L=> 4>?CAB8<>3> @07<5@0 C:070==>3> 2 AE5<5 A C:070=85< 8<5=8</td> </tr> <tr> <td><b>ERR REGEXP NAME %</b></td> <td>!B@>:0 =5 A>>B25BAB2C5B @53C;O@=><C 2K@065=8N C:070==><C 2 AE5<5 A C:070=85< 8<5=8</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.add_field( 'site', 'info/name', '""'::jsonb );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#remove_field66" name="remove_field66">remove_field</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> <div class="in" data-req="1" title="CBL : 40==K<" data-key="doc_path_data">VARCHAR</div><span>,</span> )</td> <td> #40;5=85 ?>;O 87 4>:C<5=B>2 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>PATH IS BAD</b></td> <td>5?@028;L=K9 ?CBL</td> </tr> <tr> <td><b>PATH ISSET</b></td> <td>5;L7O C40;8BL ?> MB><C ?CB8, B0: :0: >= ACI5AB2C5B 2 AE5<5 8 O2;O5BAO >1O70B5;L=K< : 70?>;=5=8N</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.remove_field( 1, 'info/name' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="" title="">VOID</div> <a href="#remove_field67" name="remove_field67">remove_field</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> <div class="in" data-req="1" title="CBL : 40==K<" data-key="doc_path_data">VARCHAR</div><span>,</span> )</td> <td> #40;5=85 ?>;O 87 4>:C<5=B>2 2=CB@8 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> <tr> <td><b>PATH IS BAD</b></td> <td>5?@028;L=K9 ?CBL</td> </tr> <tr> <td><b>PATH ISSET</b></td> <td>5;L7O C40;8BL ?> MB><C ?CB8, B0: :0: >= ACI5AB2C5B 2 AE5<5 8 O2;O5BAO >1O70B5;L=K< : 70?>;=5=8N</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.remove_field( 'site', 'info/name' );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="list_fields" title="!?8A>: ?>;59 =>4K">TEXT[]</div> <a href="#get_fields68" name="get_fields68">get_fields</a> ( <div class="in" data-req="1" title="ID =>4K" data-key="node_id">INT</div><span>,</span> )</td> <td> >;CG5=85 A?8A:0 ?>;59 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.get_fields( 1 );</td> </tr> <tr> <td class="td_func"><div class="out" data-key="list_fields" title="!?8A>: ?>;59 =>4K">TEXT[]</div> <a href="#get_fields69" name="get_fields69">get_fields</a> ( <div class="in" data-req="1" title="<O =>4K" data-key="node_name">VARCHAR</div><span>,</span> )</td> <td> >;CG5=85 A?8A:0 ?>;59 =>4K <div> <div class="title_exceptions">A:;NG5=8O</div> <table class="table_exceptions"> <tr> <td>;NG</td> <td>?8A0=85</td> </tr> <tr> <td><b>NODE NOT FOUND</b></td> <td>>40 =5 =0945=0</td> </tr> <tr> <td><b>WRONG PARAMS</b></td> <td>5?@028;L=K5 ?0@0<5B@K</td> </tr> </table> </div> </td> <td style="width:35%">SELECT schema_docs.get_fields( 'site' );</td> </tr> </table> <h2 style="margin-top:50px">SQL</h2> <label><O AE5<K: <input value="schema_docs" class="schema_name" /> <pre> CREATE SCHEMA IF NOT EXISTS schema_docs; CREATE TABLE schema_docs.nodes( id SERIAL PRIMARY KEY, pid INT REFERENCES schema_docs.nodes(id) ON DELETE CASCADE, path VARCHAR NOT NULL, data JSONB, count_docs INT NOT NULL DEFAULT 0, count_remove_docs INT NOT NULL DEFAULT 0, count_partition INT NOT NULL DEFAULT 1, partition_size INT NOT NULL DEFAULT 50000, count_in_partition INT NOT NULL DEFAULT 0, index_docs_id BOOLEAN NOT NULL DEFAULT true, index_docs_name BOOLEAN NOT NULL DEFAULT false, json_schema_save JSONB, json_schema_validate JSONB, CHECK( path ~ '^[a-zA-Z0-9\-_/]{1,}$' ), CHECK( count_docs >= 0 AND count_remove_docs >= 0 AND count_docs >= count_remove_docs ), CHECK( count_partition >= 1 AND count_in_partition >= 0 ), CHECK( partition_size > 1 ), CHECK( count_in_partition >= 0 AND count_in_partition <= partition_size ), UNIQUE( path ) ); CREATE TABLE schema_docs.nodes_indexes( id SERIAL, id_node INT REFERENCES schema_docs.nodes(id) ON DELETE CASCADE, path VARCHAR NOT NULL, type_index SMALLINT NOT NULL, CHECK( type_index = 0 OR type_index = 1 ), -- 0 - index, 1 - gin UNIQUE( id_node, path, type_index ) ); CREATE TABLE schema_docs.docs( id INT, id_node INT, name VARCHAR(255), data JSONB, CHECK( name ~ '^[a-zA-Z0-9\-_]{1,255}$' OR name IS NULL ) ) PARTITION BY LIST( id_node ); CREATE OR REPLACE FUNCTION schema_docs._trg_remove_node() RETURNS TRIGGER AS $$ BEGIN EXECUTE 'ALTER TABLE schema_docs.docs DETACH PARTITION schema_docs.docs_node_' || OLD.id; EXECUTE 'DROP TABLE schema_docs.docs_node_' || OLD.id; RETURN NEW; END; $$ LANGUAGE plpgsql; CREATE TRIGGER nodes_del AFTER DELETE ON schema_docs.nodes FOR EACH ROW EXECUTE PROCEDURE schema_docs._trg_remove_node(); CREATE OR REPLACE FUNCTION schema_docs._get_node( p_path VARCHAR ) RETURNS RECORD AS $$ DECLARE var_row RECORD; BEGIN SELECT * INTO var_row FROM schema_docs.nodes WHERE path = p_path; IF var_row IS NULL THEN RAISE EXCEPTION 'NODE NOT FOUND'; END IF; RETURN var_row; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._get_node( p_id INT ) RETURNS RECORD AS $$ DECLARE var_row RECORD; BEGIN SELECT * INTO var_row FROM schema_docs.nodes WHERE id = p_id; IF var_row IS NULL THEN RAISE EXCEPTION 'NODE NOT FOUND'; END IF; RETURN var_row; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._get_node( p_id INT, p_path VARCHAR ) RETURNS RECORD AS $$ DECLARE var_row RECORD; BEGIN IF p_id IS NOT NULL THEN SELECT * INTO var_row FROM schema_docs.nodes WHERE id = p_id; ELSIF p_path IS NOT NULL THEN SELECT * INTO var_row FROM schema_docs.nodes WHERE path = p_path; ELSE RAISE EXCEPTION 'WRONG PARAMS'; END IF; IF var_row IS NULL THEN RAISE EXCEPTION 'NODE NOT FOUND'; END IF; RETURN var_row; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._get_doc( p_node_id INT, p_id INT, p_name VARCHAR ) RETURNS RECORD AS $$ DECLARE var_row RECORD; BEGIN IF p_id IS NOT NULL THEN SELECT * INTO var_row FROM schema_docs.docs WHERE id_node = p_node_id AND id = p_id; ELSIF p_name IS NOT NULL THEN SELECT * INTO var_row FROM schema_docs.docs WHERE id_node = p_node_id AND name = p_name; ELSE RAISE EXCEPTION 'WRONG PARAMS'; END IF; IF var_row IS NULL THEN RAISE EXCEPTION 'DOC NOT FOUND'; END IF; RETURN var_row; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._validate_node_name( p_name VARCHAR ) RETURNS VOID AS $$ BEGIN IF p_name ~ '^[a-zA-Z0-9\-_]{1,}$' = FALSE OR p_name IS NULL THEN RAISE EXCEPTION 'ERROR NODE NAME'; END IF; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._validate_partition_size( p_partition_size INT ) RETURNS VOID AS $$ BEGIN IF p_partition_size < 2 OR p_partition_size IS NULL THEN RAISE EXCEPTION 'ERROR PARTITION SIZE'; END IF; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs.add_node( p_name VARCHAR, p_partition_size INT = NULL, p_data JSONB = NULL ) RETURNS INT AS $$ DECLARE var_ret INT; var_part_name VARCHAR; var_search_node_id INT; BEGIN PERFORM schema_docs._validate_node_name( p_name ); SELECT id INTO var_search_node_id FROM schema_docs.nodes WHERE path = p_name; IF var_search_node_id IS NOT NULL THEN RAISE EXCEPTION 'DUPLICATE NODE NAME'; END IF; IF p_partition_size IS NOT NULL THEN PERFORM schema_docs._validate_partition_size( p_partition_size ); INSERT INTO schema_docs.nodes( id, path, partition_size, data ) VALUES ( DEFAULT, p_name, p_partition_size, p_data ) RETURNING id INTO var_ret; ELSE INSERT INTO schema_docs.nodes( id, path, data ) VALUES ( DEFAULT, p_name, p_data ) RETURNING id INTO var_ret; END IF; var_part_name := 'docs_node_' || var_ret || '_p_1'; EXECUTE 'CREATE TABLE schema_docs.docs_node_' || var_ret || ' partition OF schema_docs.docs FOR VALUES IN('|| var_ret || ') PARTITION BY RANGE( id )'; IF p_partition_size IS NOT NULL THEN EXECUTE 'CREATE TABLE schema_docs.' || var_part_name || ' partition OF schema_docs.docs_node_'|| var_ret || ' FOR VALUES FROM(1) TO (' || p_partition_size || ')'; ELSE EXECUTE 'CREATE TABLE schema_docs.' || var_part_name || ' partition OF schema_docs.docs_node_'|| var_ret || ' FOR VALUES FROM(1) TO (50000)'; END IF; EXECUTE 'CREATE INDEX index_id_' || var_part_name || ' ON schema_docs.' || var_part_name || ' (id)'; RETURN var_ret; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.add_node( p_path VARCHAR, p_name VARCHAR, p_partition_size INT = NULL, p_data JSONB = NULL ) RETURNS INT AS $$ DECLARE var_target_node RECORD; var_ret INT; BEGIN var_target_node := schema_docs._get_node( p_path ); var_ret := schema_docs.add_node( p_name, p_partition_size, p_data ); UPDATE schema_docs.nodes SET path = var_target_node.path || '/' || p_name, pid = var_target_node.id WHERE id = var_ret; RETURN var_ret; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.add_node( p_id INT, p_name VARCHAR, p_partition_size INT = NULL, p_data JSONB = NULL ) RETURNS INT AS $$ DECLARE var_target_node RECORD; var_ret INT; BEGIN var_target_node := schema_docs._get_node( p_id ); var_ret := schema_docs.add_node( p_name, p_partition_size, p_data ); UPDATE schema_docs.nodes SET path = var_target_node.path || '/' || p_name, pid = var_target_node.id WHERE id = var_ret; RETURN var_ret; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.rename_node( p_old_name VARCHAR, p_new_name VARCHAR ) RETURNS VOID AS $$ DECLARE var_target_node RECORD; var_arr_path text[]; BEGIN PERFORM schema_docs._validate_node_name( p_new_name ); var_target_node := schema_docs._get_node( p_old_name ); var_arr_path := regexp_split_to_array( var_target_node.path, '/' ); var_arr_path[array_length(var_arr_path,1)] = p_new_name; UPDATE schema_docs.nodes SET path = regexp_replace( path, ( '^' || var_target_node.path ), array_to_string( var_arr_path, '/' ) ) WHERE path LIKE ( var_target_node.path || '%' ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.rename_node( p_node_id INT, p_new_name VARCHAR ) RETURNS VOID AS $$ DECLARE var_target_node RECORD; var_arr_path text[]; BEGIN PERFORM schema_docs._validate_node_name( p_new_name ); var_target_node := schema_docs._get_node( p_node_id ); var_arr_path := regexp_split_to_array( var_target_node.path, '/' ); var_arr_path[array_length(var_arr_path,1)] = p_new_name; UPDATE schema_docs.nodes SET path = regexp_replace( path, ( '^' || var_target_node.path ), array_to_string( var_arr_path, '/' ) ) WHERE path LIKE ( var_target_node.path || '%' ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._move_node( p_node_id INT, p_target_node_id INT, p_node_path VARCHAR, p_target_node_path VARCHAR ) RETURNS VOID AS $$ DECLARE var_node RECORD; var_target_node RECORD; var_arr_path TEXT[]; var_new_path VARCHAR; var_target_node_id INT := NULL; var_target_node_path VARCHAR := ''; BEGIN IF p_node_id IS NOT NULL AND p_target_node_id IS NOT NULL THEN var_node := schema_docs._get_node( p_node_id ); IF p_target_node_id != 0 THEN var_target_node := schema_docs._get_node( p_target_node_id ); var_target_node_id := var_target_node.id; var_target_node_path := var_target_node.path; END IF; ELSIF p_node_path IS NOT NULL AND p_target_node_path IS NOT NULL THEN var_node := schema_docs._get_node( p_node_path ); IF p_target_node_path != '' THEN var_target_node := schema_docs._get_node( p_target_node_path ); var_target_node_id := var_target_node.id; var_target_node_path := var_target_node.path; END IF; ELSE RAISE EXCEPTION 'WRONG PARAMS'; END IF; IF var_node.id = var_target_node_id OR var_target_node_path ~ ( '^' || var_node.path ) THEN RAISE EXCEPTION 'ERROR TARGET NODE'; END IF; var_arr_path := regexp_split_to_array( var_node.path, '/' ); IF var_target_node_path != '' THEN var_new_path := var_target_node_path || '/' || var_arr_path[array_length(var_arr_path,1)]; ELSE var_new_path := var_arr_path[array_length(var_arr_path,1)]; END IF; UPDATE schema_docs.nodes SET pid = var_target_node_id WHERE id = var_node.id; UPDATE schema_docs.nodes SET path = regexp_replace( path, ( '^' || var_node.path ), var_new_path ) WHERE path like ( var_node.path || '%' ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.move_node( p_node_id INT, p_target_node_id INT ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._move_node( p_node_id, p_target_node_id, NULL, NULL ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.move_node( p_node_path VARCHAR, p_target_node_path VARCHAR ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._move_node( NULL, NULL, p_node_path, p_target_node_path ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.remove_node( p_node_path VARCHAR ) RETURNS VOID AS $$ DECLARE var_node RECORD; BEGIN var_node := schema_docs._get_node( p_node_path ); DELETE FROM schema_docs.nodes WHERE id = var_node.id; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.remove_node( p_node_id INT ) RETURNS VOID AS $$ DECLARE var_node RECORD; BEGIN var_node := schema_docs._get_node( p_node_id ); DELETE FROM schema_docs.nodes WHERE id = var_node.id; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._get_nodes_structure( p_node_id INT, p_node_path VARCHAR, p_multi BOOLEAN ) RETURNS TABLE ( id INT, pid INT, path VARCHAR, partition_size INT, count INT, index_id BOOLEAN, index_name BOOLEAN, schema JSONB, data JSONB ) AS $$ DECLARE var_node RECORD; var_ret RECORD; BEGIN IF p_multi IS NULL THEN RAISE EXCEPTION 'WRONG PARAMS'; END IF; IF p_node_id IS NULL AND p_node_path IS NULL THEN FOR var_ret IN SELECT * FROM schema_docs.nodes LOOP id := var_ret.id; pid := var_ret.pid; path := var_ret.path; partition_size := var_ret.partition_size; count := var_ret.count_docs - var_ret.count_remove_docs; index_id := var_ret.index_docs_id; index_name := var_ret.index_docs_name; schema := var_ret.json_schema_save; data := var_ret.data; RETURN NEXT; END LOOP; ELSE var_node := schema_docs._get_node( p_node_id, p_node_path ); IF p_multi THEN FOR var_ret IN SELECT * FROM schema_docs.nodes WHERE nodes.path LIKE ( var_node.path || '%' ) LOOP id := var_ret.id; pid := var_ret.pid; path := var_ret.path; partition_size := var_ret.partition_size; count := var_ret.count_docs - var_ret.count_remove_docs; index_id := var_ret.index_docs_id; index_name := var_ret.index_docs_name; schema := var_ret.json_schema_save; data := var_ret.data; RETURN NEXT; END LOOP; ELSE FOR var_ret IN SELECT * FROM schema_docs.nodes WHERE nodes.path = var_node.path LOOP id := var_ret.id; pid := var_ret.pid; path := var_ret.path; partition_size := var_ret.partition_size; count := var_ret.count_docs - var_ret.count_remove_docs; index_id := var_ret.index_docs_id; index_name := var_ret.index_docs_name; schema := var_ret.json_schema_save; data := var_ret.data; RETURN NEXT; END LOOP; END IF; END IF; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.get_nodes() RETURNS TABLE ( id INT, pid INT, path VARCHAR, partition_size INT, count INT, index_id BOOLEAN, index_name BOOLEAN, schema JSONB, data JSONB ) AS $$ BEGIN RETURN QUERY SELECT * FROM schema_docs._get_nodes_structure( NULL, NULL, TRUE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.get_nodes( p_node_id INT ) RETURNS TABLE ( id INT, pid INT, path VARCHAR, partition_size INT, count INT, index_id BOOLEAN, index_name BOOLEAN, schema JSONB, data JSONB ) AS $$ BEGIN RETURN QUERY SELECT * FROM schema_docs._get_nodes_structure( p_node_id, NULL, TRUE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.get_nodes( p_node_path VARCHAR ) RETURNS TABLE ( id INT, pid INT, path VARCHAR, partition_size INT, count INT, index_id BOOLEAN, index_name BOOLEAN, schema JSONB, data JSONB ) AS $$ BEGIN RETURN QUERY SELECT * FROM schema_docs._get_nodes_structure( NULL, p_node_path, TRUE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.get_node( p_node_id INT ) RETURNS TABLE ( id INT, pid INT, path VARCHAR, partition_size INT, count INT, index_id BOOLEAN, index_name BOOLEAN, schema JSONB, data JSONB ) AS $$ BEGIN RETURN QUERY SELECT * FROM schema_docs._get_nodes_structure( p_node_id, NULL, FALSE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.get_node( p_node_path VARCHAR ) RETURNS TABLE ( id INT, pid INT, path VARCHAR, partition_size INT, count INT, index_id BOOLEAN, index_name BOOLEAN, schema JSONB, data JSONB ) AS $$ BEGIN RETURN QUERY SELECT * FROM schema_docs._get_nodes_structure( NULL, p_node_path, FALSE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._path_to_array( p_path VARCHAR ) RETURNS TEXT[] AS $$ DECLARE var_arr TEXT[] := regexp_split_to_array( p_path, E'\\/\\/' ); var_length_arr INT := array_length( var_arr, 1 ); var_i INT; var_ret TEXT[]; var_i_sub INT; var_arr_sub TEXT[]; var_length_arr_sub INT; var_length_ret INT; BEGIN FOR var_i IN 1..var_length_arr LOOP var_arr_sub := regexp_split_to_array( var_arr[var_i], E'\\/' ); var_length_arr_sub := array_length( var_arr_sub, 1 ); FOR var_i_sub IN 1..var_length_arr_sub LOOP IF var_length_arr > 1 AND var_i > 1 AND var_i_sub = 1 THEN var_length_ret := array_length( var_ret, 1 ); var_ret[var_length_ret] := var_ret[var_length_ret] || '/' || var_arr_sub[var_i_sub]; ELSE var_ret := var_ret || var_arr_sub[var_i_sub]; END IF; END LOOP; END LOOP; RETURN var_ret; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._json_schema_to_jsquery( p_name varchar, p_jsonb jsonb ) RETURNS varchar AS $$ DECLARE var_ret varchar := '(('; var_length_arr int; var_i int; var_ret_add varchar; BEGIN IF p_jsonb->>'t' = 'string' THEN IF p_jsonb ? 'm' OR p_jsonb ? 'M' OR p_jsonb ? 'e' THEN RETURN ''; END IF; END IF; IF p_jsonb->>'t' = 'number' THEN var_ret := var_ret || p_name || ' IS NUMERIC '; ELSIF p_jsonb->>'t' = 'string' THEN var_ret := var_ret || p_name || ' IS STRING '; ELSIF p_jsonb->>'t' = 'boolean' THEN var_ret := var_ret || p_name || ' IS BOOLEAN '; ELSIF p_jsonb->>'t' = 'object' THEN var_ret := var_ret || p_name || ' IS OBJECT '; ELSIF p_jsonb->>'t' = 'array' THEN var_ret := var_ret || p_name || ' IS ARRAY '; END IF; IF p_jsonb->>'t' = 'number' THEN IF p_jsonb ? 'm' THEN var_ret := var_ret || ' AND ' || p_name || ' >= ' || (p_jsonb->>'m')::varchar; END IF; IF p_jsonb ? 'M' THEN var_ret := var_ret || ' AND ' || p_name || ' <= ' || (p_jsonb->>'M')::varchar; END IF; ELSIF p_jsonb->>'t' = 'array' THEN IF p_jsonb ? 'm' THEN var_ret := var_ret || ' AND ' || p_name || '.@# >= ' || (p_jsonb->>'m')::varchar; END IF; IF p_jsonb ? 'M' THEN var_ret := var_ret || ' AND ' || p_name || '.@# <= ' || (p_jsonb->>'M')::varchar; END IF; END IF; IF p_jsonb->>'t' = 'object' THEN var_length_arr := jsonb_array_length( p_jsonb->'d' )-1; FOR var_i IN 0..var_length_arr LOOP var_ret_add := schema_docs._json_schema_to_jsquery( p_name || '."' || (p_jsonb->'d'->var_i->>'n')::varchar || '"', p_jsonb->'d'->var_i ); IF var_ret_add = '' THEN RETURN ''; ELSE var_ret := var_ret || ' AND ' || var_ret_add; END IF; END LOOP; ELSIF p_jsonb->>'t' = 'array' THEN var_ret_add := schema_docs._json_schema_to_jsquery( p_name || '.#:', p_jsonb->'d' ); IF var_ret_add = '' THEN RETURN ''; ELSE var_ret := var_ret || ' AND ' || var_ret_add; END IF; END IF; var_ret := var_ret || ')'; IF p_jsonb ? 'r' AND (p_jsonb->>'r')::boolean = false THEN var_ret := var_ret || ' OR NOT ' || p_name || ' = *'; END IF; var_ret := var_ret || ')'; RETURN var_ret; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._build_parts_tpl_jsonb( p_tpl jsonb, p_prefix varchar = null, p_item boolean = false ) RETURNS jsonb AS $$ DECLARE var_ret jsonb := '{"data":{}}'::jsonb; var_length_arr int; var_i int; var_obj jsonb := '{}'::jsonb; var_prefix varchar := ''; var_name_jsquery varchar; BEGIN IF p_item = false THEN var_ret := var_ret || jsonb_build_object( 'full', jsonb_build_object( 'schema', p_tpl, 'jsquery', schema_docs._json_schema_to_jsquery( '$', p_tpl ) ) ); ELSE var_prefix := p_prefix || (p_tpl->>'n') || '/'; END IF; IF p_tpl->>'t' = 'object' THEN var_length_arr := jsonb_array_length( p_tpl->'d' )-1; FOR var_i IN 0..var_length_arr LOOP var_name_jsquery := '$."' || ( p_tpl->'d'->var_i->>'n' ) || '"'; var_obj := var_obj || jsonb_build_object( var_prefix || ( p_tpl->'d'->var_i->>'n' ) , jsonb_build_object( 'schema', p_tpl->'d'->var_i, 'jsquery', schema_docs._json_schema_to_jsquery( var_name_jsquery, p_tpl->'d'->var_i ) ) ); IF p_tpl->'d'->var_i->>'t' = 'object' THEN var_obj := var_obj || schema_docs._build_parts_tpl_jsonb( p_tpl->'d'->var_i, var_prefix, true ); END IF; END LOOP; var_ret := var_ret || jsonb_build_object( 'data', var_obj ); END IF; IF p_item THEN RETURN var_obj; ELSE RETURN var_ret; END IF; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._build_tpl_jsonb(p_tpl jsonb, p_item_object boolean = false ) RETURNS jsonb AS $$ DECLARE var_ret jsonb := '{}'::jsonb; var_type varchar; var_length_arr int; var_i int; var_arr jsonb[]; BEGIN IF jsonb_typeof( p_tpl ) != 'object' THEN RAISE EXCEPTION 'ERR FORMAT'; END IF; IF p_tpl ? 'type' THEN IF p_item_object THEN IF p_tpl ? 'name' THEN IF jsonb_typeof( p_tpl->'name' ) = 'string' THEN var_ret := var_ret || jsonb_build_object( 'n', p_tpl->'name' ); ELSE RAISE EXCEPTION 'ERR NAME TYPE'; END IF; ELSE RAISE EXCEPTION 'NO NAME'; END IF; IF p_tpl ? 'required' THEN IF jsonb_typeof( p_tpl->'required' ) = 'boolean' THEN var_ret := var_ret || jsonb_build_object( 'r', p_tpl->'required' ); ELSE RAISE EXCEPTION 'ERR REQUIRED TYPE'; END IF; END IF; END IF; IF jsonb_typeof( p_tpl->'type' ) = 'string' THEN var_type = p_tpl->>'type'; IF var_type = 'object' THEN var_ret := var_ret || '{"t":"object"}'::jsonb; IF p_tpl ? 'data' THEN IF jsonb_typeof( p_tpl->'data' ) = 'array' THEN var_length_arr := jsonb_array_length( p_tpl->'data' )-1; FOR var_i IN 0..var_length_arr LOOP var_arr := var_arr || schema_docs._build_tpl_jsonb( p_tpl->'data'->var_i, true ); END LOOP; var_ret := var_ret || jsonb_build_object( 'd', var_arr ); ELSE RAISE EXCEPTION 'ERR DATA TYPE'; END IF; END IF; ELSIF var_type = 'array' THEN var_ret := var_ret || '{"t":"array"}'::jsonb; IF p_tpl ? 'min' THEN IF jsonb_typeof( p_tpl->'min' ) = 'number' THEN IF (p_tpl->>'min')::int < 0 THEN RAISE EXCEPTION 'ERR MINCOUNT LESS ZERO'; ELSE var_ret := var_ret || jsonb_build_object( 'm', p_tpl->'min' ); END IF; ELSE RAISE EXCEPTION 'ERR MINCOUNT TYPE'; END IF; END IF; IF p_tpl ? 'max' THEN IF jsonb_typeof( p_tpl->'max' ) = 'number' THEN IF (p_tpl->>'max')::int < 0 THEN RAISE EXCEPTION 'ERR MAXCOUNT LESS ZERO'; ELSE var_ret := var_ret || jsonb_build_object( 'M', p_tpl->'max' ); END IF; ELSE RAISE EXCEPTION 'ERR MAXCOUNT TYPE'; END IF; END IF; IF p_tpl ? 'min' AND p_tpl ? 'max' AND p_tpl->'min' > p_tpl->'max' THEN RAISE EXCEPTION 'ERR MINCOUNT MAXCOUNT'; END IF; IF p_tpl ? 'data' THEN IF jsonb_typeof( p_tpl->'data' ) = 'object' THEN var_ret := var_ret || jsonb_build_object( 'd', schema_docs._build_tpl_jsonb( p_tpl->'data' ) ); ELSE RAISE EXCEPTION 'ERR DATA TYPE'; END IF; END IF; ELSIF var_type = 'number' THEN var_ret := var_ret || '{"t":"number"}'::jsonb; IF p_tpl ? 'min' THEN IF jsonb_typeof( p_tpl->'min' ) = 'number' THEN var_ret := var_ret || jsonb_build_object( 'm', p_tpl->'min' ); ELSE RAISE EXCEPTION 'ERR MIN TYPE'; END IF; END IF; IF p_tpl ? 'max' THEN IF jsonb_typeof( p_tpl->'max' ) = 'number' THEN var_ret := var_ret || jsonb_build_object( 'M', p_tpl->'max' ); ELSE RAISE EXCEPTION 'ERR MAX TYPE'; END IF; END IF; IF p_tpl ? 'min' AND p_tpl ? 'max' AND p_tpl->'min' > p_tpl->'max' THEN RAISE EXCEPTION 'ERR MIN MAX'; END IF; ELSIF var_type = 'string' THEN var_ret := var_ret || '{"t":"string"}'::jsonb; IF p_tpl ? 'min' THEN IF jsonb_typeof( p_tpl->'min' ) = 'number' THEN IF (p_tpl->>'min')::int < 0 THEN RAISE EXCEPTION 'ERR MINLENGTH LESS ZERO'; ELSE var_ret := var_ret || jsonb_build_object( 'm', p_tpl->'min' ); END IF; ELSE RAISE EXCEPTION 'ERR MINLENGTH TYPE'; END IF; END IF; IF p_tpl ? 'max' THEN IF jsonb_typeof( p_tpl->'max' ) = 'number' THEN IF (p_tpl->>'max')::int < 0 THEN RAISE EXCEPTION 'ERR MAXLENGTH LESS ZERO'; ELSE var_ret := var_ret || jsonb_build_object( 'M', p_tpl->'max' ); END IF; ELSE RAISE EXCEPTION 'ERR MAXLENGTH TYPE'; END IF; END IF; IF p_tpl ? 'min' AND p_tpl ? 'max' AND p_tpl->'min' > p_tpl->'max' THEN RAISE EXCEPTION 'ERR MINLENGTH MAXLENGTH'; END IF; IF p_tpl ? 'regexp' THEN IF jsonb_typeof( p_tpl->'regexp' ) = 'string' THEN var_ret := var_ret || jsonb_build_object( 'e', p_tpl->'regexp' ); ELSE RAISE EXCEPTION 'ERR REGEXP TYPE'; END IF; END IF; ELSIF var_type = 'boolean' THEN var_ret := var_ret || '{"t":"boolean"}'::jsonb; ELSE RAISE EXCEPTION 'TYPE UNKNOWN'; END IF; ELSE RAISE EXCEPTION 'TYPE IS NOT STRING'; END IF; ELSE RAISE EXCEPTION 'NO TYPE'; END IF; RETURN var_ret; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._validate_jsonb(p_tpl jsonb, p_data jsonb) RETURNS boolean AS $$ DECLARE var_row jsonb; var_length_arr int; var_i int := 0; var_name text; BEGIN IF jsonb_typeof( p_data ) != p_tpl->>'t' THEN RAISE EXCEPTION 'ERROR TYPE'; END IF; IF p_tpl->>'t' = 'object' THEN IF p_tpl ? 'd' THEN var_length_arr := jsonb_array_length( p_tpl->'d' )-1; FOR var_i IN 0..var_length_arr LOOP var_name = p_tpl->'d'->var_i->>'n'; IF p_data ? var_name THEN IF p_tpl->'d'->var_i->>'t' != jsonb_typeof( p_data->var_name ) THEN RAISE EXCEPTION 'ERR TYPE NAME %', p_tpl->'d'->var_i->>'n'; END IF; IF p_tpl->'d'->var_i ? 't' THEN ELSE RAISE EXCEPTION 'ERR NOT TYPE NAME %', p_tpl->'d'->var_i->>'n'; END IF; IF p_tpl->'d'->var_i->>'t' = 'number' THEN IF p_tpl->'d'->var_i ? 'm' THEN IF p_data->var_name < p_tpl->'d'->var_i->'m' THEN RAISE EXCEPTION 'ERR MIN NAME %', p_tpl->'d'->var_i->>'n'; END IF; END IF; IF p_tpl->'d'->var_i ? 'M' THEN IF p_data->var_name > p_tpl->'d'->var_i->'M' THEN RAISE EXCEPTION 'ERR MAX NAME %', p_tpl->'d'->var_i->>'n'; END IF; END IF; ELSIF p_tpl->'d'->var_i->>'t' = 'string' THEN IF p_tpl->'d'->var_i ? 'M' THEN IF char_length( p_data->>var_name ) > (p_tpl->'d'->var_i->>'M')::int THEN RAISE EXCEPTION 'ERR MAXLENGTH NAME %', p_tpl->'d'->var_i->>'n'; END IF; END IF; IF p_tpl->'d'->var_i ? 'm' THEN IF char_length( p_data->>var_name ) < (p_tpl->'d'->var_i->>'m')::int THEN RAISE EXCEPTION 'ERR MINLENGTH NAME %', p_tpl->'d'->var_i->>'n'; END IF; END IF; IF p_tpl->'d'->var_i ? 'e' THEN IF (p_data->>var_name)::text ~ (p_tpl->'d'->var_i->>'e')::text THEN ELSE RAISE EXCEPTION 'ERR REGEXP NAME %', p_tpl->'d'->var_i->>'n'; END IF; END IF; ELSIF p_tpl->'d'->var_i->>'t' = 'object' THEN PERFORM schema_docs._validate_jsonb( p_tpl->'d'->var_i, p_data->var_name ); ELSIF p_tpl->'d'->var_i->>'t' = 'array' THEN PERFORM schema_docs._validate_jsonb( p_tpl->'d'->var_i, p_data->var_name ); END IF; ELSE IF p_tpl->'d'->var_i ? 'r' AND (p_tpl->'d'->var_i->>'r')::boolean = FALSE THEN ELSE RAISE EXCEPTION 'NOT NAME %', p_tpl->'d'->var_i->>'n'; END IF; END IF; END LOOP; END IF; ELSIF p_tpl->>'t' = 'array' THEN IF p_tpl ? 'm' THEN IF jsonb_array_length( p_data ) < (p_tpl->>'m')::integer THEN RAISE EXCEPTION 'ERR MINCOUNT NAME %', p_tpl->>'n'; END IF; END IF; IF p_tpl ? 'M' THEN IF jsonb_array_length( p_data ) > (p_tpl->>'M')::integer THEN RAISE EXCEPTION 'ERR MAXCOUNT NAME %', p_tpl->>'n'; END IF; END IF; IF p_tpl ? 'd' THEN var_length_arr := jsonb_array_length( p_data )-1; FOR var_i IN 0..var_length_arr LOOP PERFORM schema_docs._validate_jsonb( p_tpl->'d', p_data->var_i ); END LOOP; END IF; ELSIF p_tpl->>'t' = 'number' THEN IF p_tpl ? 'm' THEN IF p_data < p_tpl->'m' THEN RAISE EXCEPTION 'ERR MIN NAME %', p_tpl->>'n'; END IF; END IF; IF p_tpl ? 'M' THEN IF p_data > p_tpl->'M' THEN RAISE EXCEPTION 'ERR MAX NAME %', p_tpl->>'n'; END IF; END IF; ELSIF p_tpl->>'t' = 'string' THEN IF p_tpl ? 'M' THEN IF char_length( p_data ) > (p_tpl->>'M')::int THEN RAISE EXCEPTION 'ERR MAXLENGTH NAME %', p_tpl->>'n'; END IF; END IF; IF p_tpl ? 'm' THEN IF char_length( p_data ) < (p_tpl->>'m')::int THEN RAISE EXCEPTION 'ERR MINLENGTH NAME %', p_tpl->>'n'; END IF; END IF; IF p_tpl ? 'e' THEN IF (p_data)::text ~ (p_tpl->>'e')::text THEN ELSE RAISE EXCEPTION 'ERR REGEXP NAME %', p_tpl->>'n'; END IF; END IF; END IF; RETURN TRUE; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._set_node_data( p_node_id INT, p_node_path VARCHAR, p_path VARCHAR, p_data JSONB ) RETURNS VOID AS $$ DECLARE var_node RECORD; var_path_arr TEXT[]; BEGIN var_node := schema_docs._get_node( p_node_id, p_node_path ); IF p_data IS NULL THEN RAISE EXCEPTION 'WRONG PARAMS'; END IF; IF p_path IS NULL THEN UPDATE schema_docs.nodes SET data = p_data WHERE id = var_node.id; ELSE var_path_arr := schema_docs._path_to_array( p_path ); IF var_node.data IS NULL THEN IF array_length( var_path_arr, 1 ) > 1 THEN RAISE EXCEPTION 'SAVE ERROR'; ELSE UPDATE schema_docs.nodes SET data = jsonb_set( '{}'::JSONB, var_path_arr, p_data ) WHERE id = var_node.id; END IF; ELSE var_node.data := jsonb_set( var_node.data, var_path_arr, p_data ); IF var_node.data#>var_path_arr IS NULL THEN RAISE EXCEPTION 'SAVE ERROR'; ELSE UPDATE schema_docs.nodes SET data = var_node.data WHERE id = var_node.id; END IF; END IF; END IF; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.set_node_data( p_node_id INT, p_path VARCHAR, p_data JSONB ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._set_node_data( p_node_id, NULL, p_path, p_data ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.set_node_data( p_node_path VARCHAR, p_path VARCHAR, p_data JSONB ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._set_node_data( NULL, p_node_path, p_path, p_data ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.set_node_data( p_node_id INT, p_data JSONB ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._set_node_data( p_node_id, NULL, NULL, p_data ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.set_node_data( p_node_path VARCHAR, p_data JSONB ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._set_node_data( NULL, p_node_path, NULL, p_data ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._get_node_data( p_node_id INT, p_node_path VARCHAR, p_path VARCHAR ) RETURNS JSONB AS $$ DECLARE var_node RECORD; var_path_arr TEXT[]; BEGIN var_node := schema_docs._get_node( p_node_id, p_node_path ); IF p_path IS NULL THEN RETURN var_node.data; ELSE var_path_arr := schema_docs._path_to_array( p_path ); RETURN var_node.data#>var_path_arr; END IF; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.get_node_data( p_node_id INT, p_path VARCHAR ) RETURNS JSONB AS $$ BEGIN RETURN schema_docs._get_node_data( p_node_id, NULL, p_path ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.get_node_data( p_node_path VARCHAR, p_path VARCHAR ) RETURNS JSONB AS $$ BEGIN RETURN schema_docs._get_node_data( NULL, p_node_path, p_path ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.get_node_data( p_node_id INT ) RETURNS JSONB AS $$ BEGIN RETURN schema_docs._get_node_data( p_node_id, NULL, NULL ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.get_node_data( p_node_path VARCHAR ) RETURNS JSONB AS $$ BEGIN RETURN schema_docs._get_node_data( NULL, p_node_path, NULL ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._remove_node_data( p_node_id INT, p_node_path VARCHAR, p_path VARCHAR ) RETURNS VOID AS $$ DECLARE var_node RECORD; var_path_arr TEXT[]; BEGIN var_node := schema_docs._get_node( p_node_id, p_node_path ); IF p_path IS NULL THEN UPDATE schema_docs.nodes SET data = NULL WHERE id = var_node.id; ELSE var_path_arr := schema_docs._path_to_array( p_path ); UPDATE schema_docs.nodes SET data = var_node.data#-var_path_arr WHERE id = var_node.id; END IF; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.remove_node_data( p_node_id INT, p_path VARCHAR ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._remove_node_data( p_node_id, NULL, p_path ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.remove_node_data( p_node_path VARCHAR, p_path VARCHAR ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._remove_node_data( NULL, p_node_path, p_path ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.remove_node_data( p_node_id INT ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._remove_node_data( p_node_id, NULL, NULL ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.remove_node_data( p_node_path VARCHAR ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._remove_node_data( NULL, p_node_path, NULL ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._add_doc( p_node_id INT, p_node_path VARCHAR, p_doc_name VARCHAR, p_data JSONB, p_strict_validate BOOLEAN ) RETURNS INT AS $$ DECLARE var_node RECORD; var_search_doc_id INT; var_part_name VARCHAR; var_part_size_prev INT; var_part_size_next INT; var_ret INT; var_index RECORD; var_path TEXT[]; var_length_path_arr INT; var_path_str VARCHAR; BEGIN IF p_data IS NULL OR p_strict_validate IS NULL THEN RAISE EXCEPTION 'WRONG PARAMS'; END IF; var_node := schema_docs._get_node( p_node_id, p_node_path ); IF p_doc_name IS NOT NULL THEN SELECT id INTO var_search_doc_id FROM schema_docs.docs WHERE name = p_doc_name; IF var_search_doc_id IS NOT NULL THEN RAISE EXCEPTION 'NAME IS DUPLICATE'; END IF; END IF; IF var_node.json_schema_validate IS NOT NULL THEN IF p_strict_validate THEN PERFORM schema_docs._validate_jsonb( var_node.json_schema_validate->'full'->'schema', p_data ); ELSE IF var_node.json_schema_validate->'full' ? 'jsquery' THEN IF (var_node.json_schema_validate->'full'->>'jsquery')::jsquery @@ p_data = false THEN RAISE EXCEPTION 'DATA IS BAD'; END IF; ELSE PERFORM schema_docs._validate_jsonb( var_node.json_schema_validate->'full'->'schema', p_data ); END IF; END IF; END IF; var_ret := var_node.count_docs + 1; IF var_node.count_in_partition = var_node.partition_size - 1 THEN var_part_name := 'docs_node_' || var_node.id || '_p_' || ( var_node.count_partition + 1 ); var_part_size_prev := var_node.partition_size * var_node.count_partition; var_part_size_next := var_node.partition_size * ( var_node.count_partition + 1 ); EXECUTE 'CREATE TABLE schema_docs.' || var_part_name || ' partition OF schema_docs.docs_node_'|| var_node.id || ' FOR VALUES FROM( ' || var_part_size_prev || ') TO ( ' || var_part_size_next || ')'; UPDATE schema_docs.nodes SET count_in_partition = 1, count_partition = var_node.count_partition + 1, count_docs = var_ret WHERE id = var_node.id; IF var_node.index_docs_id THEN EXECUTE 'CREATE INDEX index_id_' || var_part_name || ' ON schema_docs.' || var_part_name || ' (id)'; END IF; IF var_node.index_docs_name THEN EXECUTE 'CREATE INDEX index_name_' || var_part_name || ' ON schema_docs.' || var_part_name || ' (name)'; END IF; FOR var_index IN SELECT * FROM schema_docs.nodes_indexes WHERE id_node = var_node.id LOOP var_path := schema_docs._path_to_array( var_index.path ); var_length_path_arr := array_length( var_path, 1 ); var_path_str := ''; FOR var_i_path IN 1..var_length_path_arr LOOP var_path_str := var_path_str || '->' || quote_literal( var_path[var_i_path] ); END LOOP; PERFORM schema_docs._set_user_index_create_exec( var_part_name, var_index.id, var_index.type_index, var_path_str ); END LOOP; ELSE UPDATE schema_docs.nodes SET count_in_partition = var_node.count_in_partition + 1, count_docs = var_ret WHERE id = var_node.id; END IF; INSERT INTO schema_docs.docs ( id, id_node, name, data ) VALUES ( var_ret, var_node.id, p_doc_name, p_data ); RETURN var_ret; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.add_doc( p_node_id INT, p_data JSONB, p_strict_validate BOOLEAN = FALSE ) RETURNS INT AS $$ BEGIN RETURN schema_docs._add_doc( p_node_id, NULL, NULL, p_data, p_strict_validate ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.add_doc( p_node_path VARCHAR, p_data JSONB, p_strict_validate BOOLEAN = FALSE ) RETURNS INT AS $$ BEGIN RETURN schema_docs._add_doc( NULL, p_node_path, NULL, p_data, p_strict_validate ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.add_doc( p_node_id INT, p_doc_name VARCHAR, p_data JSONB, p_strict_validate BOOLEAN = FALSE ) RETURNS INT AS $$ BEGIN RETURN schema_docs._add_doc( p_node_id, NULL, p_doc_name, p_data, p_strict_validate ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.add_doc( p_node_path VARCHAR, p_doc_name VARCHAR, p_data JSONB, p_strict_validate BOOLEAN = FALSE ) RETURNS INT AS $$ BEGIN RETURN schema_docs._add_doc( NULL, p_node_path, p_doc_name, p_data, p_strict_validate ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._edit_doc_v_path_null( p_schema_validate jsonb, p_doc_data jsonb, p_data jsonb, p_strict_validate boolean, p_concat boolean ) RETURNS void AS $$ BEGIN IF p_strict_validate THEN IF p_concat THEN PERFORM schema_docs._validate_jsonb( p_schema_validate->'full'->'schema', p_doc_data || p_data ); ELSE PERFORM schema_docs._validate_jsonb( p_schema_validate->'full'->'schema', p_data ); END IF; ELSE IF p_schema_validate->'full' ? 'jsquery' THEN IF p_concat THEN IF (p_schema_validate->'full'->>'jsquery')::jsquery @@ ( p_doc_data || p_data ) = false THEN RAISE EXCEPTION 'DATA IS BAD'; END IF; ELSE IF (p_schema_validate->'full'->>'jsquery')::jsquery @@ p_data = false THEN RAISE EXCEPTION 'DATA IS BAD'; END IF; END IF; ELSE IF p_concat THEN PERFORM schema_docs._validate_jsonb( p_schema_validate->'full'->'schema', p_doc_data || p_data ); ELSE PERFORM schema_docs._validate_jsonb( p_schema_validate->'full'->'schema', p_data ); END IF; END IF; END IF; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._edit_doc_v_path_data_null( p_schema_validate jsonb, p_doc_data jsonb, p_strict_validate boolean ) RETURNS void AS $$ BEGIN IF p_strict_validate THEN PERFORM schema_docs._validate_jsonb( p_schema_validate->'full'->'schema', p_doc_data ); ELSE IF p_schema_validate->'full' ? 'jsquery' THEN IF ( (p_schema_validate->'full'->>'jsquery')::jsquery @@ p_doc_data ) = FALSE THEN RAISE EXCEPTION 'DATA IS BAD'; END IF; ELSE PERFORM schema_docs._validate_jsonb( p_schema_validate->'full'->'schema', p_doc_data ); END IF; END IF; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._edit_doc_v_path_data( p_schema_validate jsonb, p_path varchar, p_path_name text[], p_doc_data jsonb, p_data jsonb, p_strict_validate boolean, p_concat boolean ) RETURNS void AS $$ BEGIN p_path := replace( p_path, '//', '/' ); IF p_strict_validate THEN IF p_concat THEN IF p_doc_data#>p_path_name IS NOT NULL THEN PERFORM schema_docs._validate_jsonb( p_schema_validate->'data'->p_path->'schema', p_doc_data#>p_path_name || p_data ); ELSE PERFORM schema_docs._validate_jsonb( p_schema_validate->'data'->p_path->'schema', p_data ); END IF; ELSE PERFORM schema_docs._validate_jsonb( p_schema_validate->'data'->p_path->'schema', p_data ); END IF; ELSE IF p_schema_validate->'data'->p_path ? 'jsquery' THEN IF p_concat THEN IF p_doc_data#>p_path_name IS NOT NULL THEN IF ( (p_schema_validate->'data'->p_path->>'jsquery')::jsquery @@ jsonb_build_object( p_path_name[array_length(p_path_name,1)], p_doc_data#>p_path_name || p_data ) ) = FALSE THEN RAISE EXCEPTION 'DATA IS BAD'; END IF; ELSE IF ( (p_schema_validate->'data'->p_path->>'jsquery')::jsquery @@ jsonb_build_object( p_path_name[array_length(p_path_name,1)], p_data ) ) = FALSE THEN RAISE EXCEPTION 'DATA IS BAD'; END IF; END IF; ELSE IF ( (p_schema_validate->'data'->p_path->>'jsquery')::jsquery @@ jsonb_build_object( p_path_name[array_length(p_path_name,1)], p_data ) ) = FALSE THEN RAISE EXCEPTION 'DATA IS BAD'; END IF; END IF; ELSE IF p_concat THEN IF p_doc_data#>p_path_name IS NOT NULL THEN PERFORM schema_docs._validate_jsonb( p_schema_validate->'data'->p_path->'schema', p_doc_data#>p_path_name || p_data ); ELSE PERFORM schema_docs._validate_jsonb( p_schema_validate->'data'->p_path->'schema', p_data ); END IF; ELSE PERFORM schema_docs._validate_jsonb( p_schema_validate->'data'->p_path->'schema', p_data ); END IF; END IF; END IF; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._edit_doc_u_validate( p_node_id int, p_doc_id int, p_schema_validate jsonb, p_path varchar, p_doc_data jsonb, p_data jsonb, p_strict_validate boolean, p_concat boolean ) RETURNS void AS $$ DECLARE var_doc_data jsonb; var_path_name text[]; BEGIN IF p_path = '' THEN PERFORM schema_docs._edit_doc_v_path_null( p_schema_validate, p_doc_data, p_data, p_strict_validate, p_concat ); IF p_concat THEN UPDATE schema_docs.docs SET data = data || p_data WHERE id_node = p_node_id AND id = p_doc_id; ELSE UPDATE schema_docs.docs SET data = p_data WHERE id_node = p_node_id AND id = p_doc_id; END IF; ELSE IF p_schema_validate->'data' ? replace( p_path, '//', '/' ) = FALSE THEN RAISE EXCEPTION 'PATH NOT FOUND'; END IF; var_path_name := schema_docs._path_to_array( p_path ); IF p_data IS NULL THEN var_doc_data := p_doc_data#- var_path_name; PERFORM schema_docs._edit_doc_v_path_data_null( p_schema_validate, var_doc_data, p_strict_validate ); UPDATE schema_docs.docs SET data = var_doc_data WHERE id_node = p_node_id AND id = p_doc_id; ELSE var_doc_data := p_doc_data; PERFORM schema_docs._edit_doc_v_path_data( p_schema_validate, p_path , var_path_name, var_doc_data, p_data, p_strict_validate, p_concat ); IF p_concat THEN IF p_doc_data#>var_path_name IS NOT NULL THEN UPDATE schema_docs.docs SET data = jsonb_set( data, var_path_name, p_doc_data#>var_path_name || p_data ) WHERE id_node = p_node_id AND id = p_doc_id; ELSE UPDATE schema_docs.docs SET data = jsonb_set( data, var_path_name, p_data ) WHERE id_node = p_node_id AND id = p_doc_id; END IF; ELSE UPDATE schema_docs.docs SET data = jsonb_set( data, var_path_name, p_data ) WHERE id_node = p_node_id AND id = p_doc_id; END IF; END IF; END IF; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._edit_doc_u_validate_null( p_node_id int, p_doc_id int, p_path varchar, p_doc_data jsonb, p_data jsonb, p_concat boolean ) RETURNS void AS $$ DECLARE var_path_name text[] := schema_docs._path_to_array( p_path ); BEGIN IF p_path = '' THEN IF p_concat THEN UPDATE schema_docs.docs SET data = data || p_data WHERE id_node = p_node_id AND id = p_doc_id; ELSE UPDATE schema_docs.docs SET data = p_data WHERE id_node = p_node_id AND id = p_doc_id; END IF; ELSE IF p_data IS NULL THEN UPDATE schema_docs.docs SET data = data#-var_path_name WHERE id_node = p_node_id AND id = p_doc_id; ELSE IF p_concat THEN IF p_doc_data#>var_path_name IS NOT NULL THEN UPDATE schema_docs.docs SET data = jsonb_set( data, var_path_name, p_doc_data#>var_path_name || p_data ) WHERE id_node = p_node_id AND id = p_doc_id; ELSE UPDATE schema_docs.docs SET data = jsonb_set( data, var_path_name, p_data ) WHERE id_node = p_node_id AND id = p_doc_id; END IF; ELSE UPDATE schema_docs.docs SET data = jsonb_set( data, var_path_name, p_data ) WHERE id_node = p_node_id AND id = p_doc_id; END IF; END IF; END IF; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._edit_doc( p_node_id int, p_node_path VARCHAR, p_doc_id int, p_doc_name VARCHAR, p_path varchar, p_data jsonb, p_strict_validate boolean, p_concat boolean ) RETURNS void AS $$ DECLARE var_node RECORD; var_doc RECORD; BEGIN var_node := schema_docs._get_node( p_node_id, p_node_path ); var_doc := schema_docs._get_doc( var_node.id, p_doc_id, p_doc_name ); IF p_strict_validate IS NULL OR p_concat IS NULL THEN RAISE EXCEPTION 'WRONG PARAMS'; END IF; IF p_data IS NULL AND p_path = '' THEN p_data := '{}'::jsonb; END IF; IF p_data IS NOT NULL AND ( jsonb_typeof( p_data ) != 'object' AND jsonb_typeof( p_data ) != 'array' ) THEN p_concat = false; END IF; IF var_node.json_schema_validate IS NULL THEN PERFORM schema_docs._edit_doc_u_validate_null( var_node.id, var_doc.id, p_path, var_doc.data, p_data, p_concat ); ELSE PERFORM schema_docs._edit_doc_u_validate( var_node.id, var_doc.id, var_node.json_schema_validate, p_path, var_doc.data, p_data, p_strict_validate, p_concat ); END IF; END $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.edit_doc( p_node_id int, p_doc_id int, p_data jsonb, p_strict_validate boolean = false, p_concat boolean = true ) RETURNS void AS $$ BEGIN PERFORM schema_docs._edit_doc( p_node_id, NULL, p_doc_id, NULL, '', p_data, p_strict_validate, p_concat ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.edit_doc( p_node_id int, p_doc_name VARCHAR, p_data jsonb, p_strict_validate boolean = false, p_concat boolean = true ) RETURNS void AS $$ BEGIN PERFORM schema_docs._edit_doc( p_node_id, NULL, NULL, p_doc_name, '', p_data, p_strict_validate, p_concat ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.edit_doc( p_node_path VARCHAR, p_doc_id int, p_data jsonb, p_strict_validate boolean = false, p_concat boolean = true ) RETURNS void AS $$ BEGIN PERFORM schema_docs._edit_doc( NULL, p_node_path, p_doc_id, NULL, '', p_data, p_strict_validate, p_concat ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.edit_doc( p_node_path VARCHAR, p_doc_name VARCHAR, p_data jsonb, p_strict_validate boolean = false, p_concat boolean = true ) RETURNS void AS $$ BEGIN PERFORM schema_docs._edit_doc( NULL, p_node_path, NULL, p_doc_name, '', p_data, p_strict_validate, p_concat ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.edit_doc( p_node_id int, p_doc_id int, p_path varchar, p_data jsonb, p_strict_validate boolean = false, p_concat boolean = true ) RETURNS void AS $$ BEGIN PERFORM schema_docs._edit_doc( p_node_id, NULL, p_doc_id, NULL, p_path, p_data, p_strict_validate, p_concat ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.edit_doc( p_node_id int, p_doc_name VARCHAR, p_path varchar, p_data jsonb, p_strict_validate boolean = false, p_concat boolean = true ) RETURNS void AS $$ BEGIN PERFORM schema_docs._edit_doc( p_node_id, NULL, NULL, p_doc_name, p_path, p_data, p_strict_validate, p_concat ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.edit_doc( p_node_path VARCHAR, p_doc_id INT, p_path varchar, p_data jsonb, p_strict_validate boolean = false, p_concat boolean = true ) RETURNS void AS $$ BEGIN PERFORM schema_docs._edit_doc( NULL, p_node_path, p_doc_id, NULL, p_path, p_data, p_strict_validate, p_concat ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.edit_doc( p_node_path VARCHAR, p_doc_name VARCHAR, p_path varchar, p_data jsonb, p_strict_validate boolean = false, p_concat boolean = true ) RETURNS void AS $$ BEGIN PERFORM schema_docs._edit_doc( NULL, p_node_path, NULL, p_doc_name, p_path, p_data, p_strict_validate, p_concat ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._edit_doc_array_v_params( p_path varchar, p_doc_data jsonb, p_path_name text[], p_pos int ) RETURNS void AS $$ BEGIN IF p_doc_data#>p_path_name IS NULL AND p_path != '' THEN RAISE EXCEPTION 'PATH NOT FOUND'; END IF; IF jsonb_typeof( p_doc_data#>p_path_name ) != 'array' THEN RAISE EXCEPTION 'TARGET DATA IS NOT ARRAY'; END IF; IF p_path != '' THEN IF jsonb_array_length( p_doc_data#>p_path_name ) <= p_pos THEN RAISE EXCEPTION 'ERROR POSITION'; END IF; ELSE IF jsonb_array_length( p_doc_data ) <= p_pos THEN RAISE EXCEPTION 'ERROR POSITION'; END IF; END IF; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._edit_doc_array_v_path_null( p_schema_validate jsonb, p_strict_validate boolean, p_arr jsonb ) RETURNS void AS $$ BEGIN IF p_schema_validate IS NOT NULL THEN IF p_strict_validate THEN PERFORM schema_docs._validate_jsonb( p_schema_validate->'full'->'schema', p_arr ); ELSE IF p_schema_validate->'full' ? 'jsquery' THEN IF ( (p_schema_validate->'full'->>'jsquery')::jsquery @@ p_arr ) = FALSE THEN RAISE EXCEPTION 'DATA IS BAD'; END IF; ELSE PERFORM schema_docs._validate_jsonb( p_schema_validate->'full'->'schema', p_arr ); END IF; END IF; END IF; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._edit_doc_array_v_path( p_schema_validate jsonb, p_strict_validate boolean, p_path varchar, p_path_name text[], p_arr jsonb ) RETURNS void AS $$ BEGIN IF p_schema_validate IS NOT NULL THEN IF p_strict_validate THEN PERFORM schema_docs._validate_jsonb( p_schema_validate->'data'->p_path->'schema', p_arr ); ELSE IF p_schema_validate->'data'->p_path ? 'jsquery' THEN IF ( (p_schema_validate->'data'->p_path->>'jsquery')::jsquery @@ jsonb_build_object( p_path_name[array_length(p_path_name,1)], p_arr ) ) = FALSE THEN RAISE EXCEPTION 'DATA IS BAD'; END IF; ELSE PERFORM schema_docs._validate_jsonb( p_schema_validate->'data'->p_path->'schema', jsonb_build_object( p_path_name[array_length(p_path_name,1)], p_arr ) ); END IF; END IF; END IF; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._edit_doc_array_u_set( p_node_id int, p_doc_id int, p_schema_validate jsonb, p_doc_data jsonb, p_strict_validate boolean, p_path varchar, p_path_name text[], p_pos int, p_data jsonb ) RETURNS void AS $$ DECLARE var_arr jsonb; BEGIN IF p_path = '' THEN var_arr := jsonb_set( p_doc_data, '{}'::text[] || p_pos::text, p_data ); PERFORM schema_docs._edit_doc_array_v_path_null( p_schema_validate, p_strict_validate, var_arr ); UPDATE schema_docs.docs SET data = var_arr WHERE id_node = p_node_id AND id = p_doc_id; ELSE var_arr := jsonb_set( p_doc_data#>p_path_name, '{}'::text[] || p_pos::text, p_data ); PERFORM schema_docs._edit_doc_array_v_path( p_schema_validate, p_strict_validate, p_path, p_path_name, var_arr ); UPDATE schema_docs.docs SET data = jsonb_set( p_doc_data, p_path_name, var_arr ) WHERE id_node = p_node_id AND id = p_doc_id; END IF; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._edit_doc_array_v_path_null_rem( p_schema_validate jsonb, p_strict_validate boolean, p_arr jsonb ) RETURNS void AS $$ BEGIN IF p_schema_validate IS NOT NULL THEN IF p_strict_validate THEN PERFORM schema_docs._validate_jsonb( p_schema_validate->'full'->'schema', p_arr ); ELSE IF p_schema_validate->'full' ? 'jsquery' THEN IF ( (p_schema_validate->'full'->>'jsquery')::jsquery @@ p_arr ) = FALSE THEN RAISE EXCEPTION 'DATA IS BAD'; END IF; ELSE PERFORM schema_docs._validate_jsonb( p_schema_validate->'full'->'schema', p_arr ); END IF; END IF; END IF; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._edit_doc_array_v_path_rem( p_schema_validate jsonb, p_strict_validate boolean, p_path varchar, p_path_name text[], p_arr jsonb ) RETURNS void AS $$ BEGIN IF p_schema_validate IS NOT NULL THEN IF p_strict_validate THEN PERFORM schema_docs._validate_jsonb( p_schema_validate->'data'->p_path->'schema', p_arr ); ELSE IF p_schema_validate->'data'->p_path ? 'jsquery' THEN IF ( (p_schema_validate->'data'->p_path->>'jsquery')::jsquery @@ jsonb_build_object( p_path_name[array_length(p_path_name,1)], p_arr ) ) = FALSE THEN RAISE EXCEPTION 'DATA IS BAD'; END IF; ELSE PERFORM schema_docs._validate_jsonb( p_schema_validate->'data'->p_path->'schema', jsonb_build_object( p_path_name[array_length(p_path_name,1)], p_arr ) ); END IF; END IF; END IF; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._edit_doc_array_u_rem( p_node_id int, p_doc_id int, p_schema_validate jsonb, p_doc_data jsonb, p_strict_validate boolean, p_path varchar, p_path_name text[], p_pos int ) RETURNS void AS $$ DECLARE var_arr jsonb; BEGIN IF p_path = '' THEN var_arr := p_doc_data- p_pos; PERFORM schema_docs._edit_doc_array_v_path_null_rem( p_schema_validate, p_strict_validate, var_arr ); UPDATE schema_docs.docs SET data = var_arr WHERE id_node = p_node_id AND id = p_doc_id; ELSE var_arr := (p_doc_data#>p_path_name)::jsonb- p_pos; PERFORM schema_docs._edit_doc_array_v_path_rem( p_schema_validate, p_strict_validate, p_path, p_path_name, var_arr ); UPDATE schema_docs.docs SET data = jsonb_set( p_doc_data, p_path_name, var_arr ) WHERE id_node = p_node_id AND id = p_doc_id; END IF; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._edit_doc_array( p_node_id int, p_node_path VARCHAR, p_doc_id INT, p_doc_name VARCHAR, p_path varchar, p_pos int, p_data jsonb, p_strict_validate boolean ) RETURNS void AS $$ DECLARE var_node RECORD; var_doc RECORD; var_path_name text[] := schema_docs._path_to_array( p_path ); BEGIN var_node := schema_docs._get_node( p_node_id, p_node_path ); var_doc := schema_docs._get_doc( var_node.id, p_doc_id, p_doc_name ); IF p_strict_validate IS NULL OR p_pos IS NULL THEN RAISE EXCEPTION 'WRONG PARAMS'; END IF; PERFORM schema_docs._edit_doc_array_v_params( p_path, var_doc.data, var_path_name, p_pos ); IF p_data IS NOT NULL THEN PERFORM schema_docs._edit_doc_array_u_set( var_node.id, var_doc.id, var_node.json_schema_validate, var_doc.data, p_strict_validate, p_path, var_path_name, p_pos, p_data ); ELSE PERFORM schema_docs._edit_doc_array_u_rem( var_node.id, var_doc.id, var_node.json_schema_validate, var_doc.data, p_strict_validate, p_path, var_path_name, p_pos ); END IF; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.edit_doc_array( p_node_id int, p_doc_id int, p_path varchar, p_pos int, p_data jsonb, p_strict_validate boolean = false ) RETURNS void AS $$ BEGIN PERFORM schema_docs._edit_doc_array( p_node_id, NULL, p_doc_id, NULL, p_path, p_pos, p_data, p_strict_validate ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.edit_doc_array( p_node_id int, p_doc_name VARCHAR, p_path varchar, p_pos int, p_data jsonb, p_strict_validate boolean = false ) RETURNS void AS $$ BEGIN PERFORM schema_docs._edit_doc_array( p_node_id, NULL, NULL, p_doc_name, p_path, p_pos, p_data, p_strict_validate ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.edit_doc_array( p_node_path VARCHAR, p_doc_id int, p_path varchar, p_pos int, p_data jsonb, p_strict_validate boolean = false ) RETURNS void AS $$ BEGIN PERFORM schema_docs._edit_doc_array( NULL, p_node_path, p_doc_id, NULL, p_path, p_pos, p_data, p_strict_validate ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.edit_doc_array( p_node_path VARCHAR, p_doc_name VARCHAR, p_path varchar, p_pos int, p_data jsonb, p_strict_validate boolean = false ) RETURNS void AS $$ BEGIN PERFORM schema_docs._edit_doc_array( NULL, p_node_path, NULL, p_doc_name, p_path, p_pos, p_data, p_strict_validate ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._remove_doc( p_node_id INT, p_node_path VARCHAR, p_doc_id INT, p_doc_name VARCHAR ) RETURNS VOID AS $$ DECLARE var_node RECORD; var_doc_id INT; BEGIN IF p_doc_name IS NULL AND p_doc_id IS NULL THEN RAISE EXCEPTION 'WRONG PARAMS'; END IF; var_node := schema_docs._get_node( p_node_id, p_node_path ); IF p_doc_id IS NOT NULL THEN SELECT id INTO var_doc_id FROM schema_docs.docs WHERE id_node = var_node.id AND id = p_doc_id; IF var_doc_id IS NOT NULL THEN DELETE FROM schema_docs.docs WHERE id_node = var_node.id AND id = p_doc_id; UPDATE schema_docs.nodes SET count_remove_docs = count_remove_docs + 1 WHERE id = var_node.id; END IF; ELSIF p_doc_name IS NOT NULL THEN SELECT id INTO var_doc_id FROM schema_docs.docs WHERE id_node = var_node.id AND name = p_doc_name; IF var_doc_id IS NOT NULL THEN DELETE FROM schema_docs.docs WHERE id_node = var_node.id AND name = p_doc_name; UPDATE schema_docs.nodes SET count_remove_docs = count_remove_docs + 1 WHERE id = var_node.id; END IF; END IF; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.remove_doc( p_node_id INT, p_doc_id INT ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._remove_doc( p_node_id, NULL, p_doc_id, NULL ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.remove_doc( p_node_id INT, p_doc_name VARCHAR ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._remove_doc( p_node_id, NULL, NULL, p_doc_name ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.remove_doc( p_node_path VARCHAR, p_doc_id INT ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._remove_doc( NULL, p_node_path, p_doc_id, NULL ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.remove_doc( p_node_path VARCHAR, p_doc_name VARCHAR ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._remove_doc( NULL, p_node_path, NULL, p_doc_name ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._set_node_partition_limit( p_node_id INT, p_node_path VARCHAR, p_partition_size INT ) RETURNS VOID AS $$ DECLARE var_node RECORD; var_doc RECORD; var_i INT; var_max_tables INT; var_part_name VARCHAR; var_part_size_prev INT := 1; var_part_size_next INT := p_partition_size; var_index RECORD; var_path_str VARCHAR; var_i_path INT; var_length_path_arr INT; var_path TEXT[]; BEGIN IF p_partition_size < 2 THEN RAISE EXCEPTION 'WRONG PARAMS'; END IF; var_node := schema_docs._get_node( p_node_id, p_node_path ); IF var_node.partition_size = p_partition_size THEN RETURN; END IF; var_max_tables := var_node.count_docs / p_partition_size + 1; FOR var_i IN 1..var_node.count_partition LOOP EXECUTE 'ALTER TABLE schema_docs.docs_node_' || var_node.id || ' DETACH PARTITION schema_docs.docs_node_' || var_node.id || '_p_' || var_i; EXECUTE 'ALTER TABLE schema_docs.docs_node_' || var_node.id || '_p_' || var_i || ' RENAME TO docs_node_' || var_node.id || '_p_' || var_i || '_'; END LOOP; FOR var_i IN 1..var_max_tables LOOP var_part_name := 'docs_node_' || var_node.id || '_p_' || var_i; IF var_i > 1 THEN var_part_size_next := var_part_size_next + p_partition_size; var_part_size_prev := var_part_size_prev + p_partition_size; END IF; EXECUTE 'CREATE TABLE schema_docs.' || var_part_name || ' partition OF schema_docs.docs_node_'|| var_node.id || ' FOR VALUES FROM( ' || var_part_size_prev || ') TO ( ' || var_part_size_next || ')'; IF var_i = 1 THEN var_part_size_prev := 0; END IF; END LOOP; FOR var_i IN 1..var_node.count_partition LOOP FOR var_doc IN EXECUTE 'SELECT id, id_node, name, data FROM schema_docs.docs_node_' || var_node.id || '_p_' || var_i || '_' LOOP INSERT INTO schema_docs.docs( id, id_node, name, data ) VALUES ( var_doc.id, var_doc.id_node, var_doc.name, var_doc.data ); END LOOP; EXECUTE 'DROP TABLE schema_docs.docs_node_' || var_node.id || '_p_' || var_i || '_'; END LOOP; FOR var_i IN 1..var_max_tables LOOP var_part_name := 'docs_node_' || var_node.id || '_p_' || var_i; IF var_node.index_docs_id THEN EXECUTE 'CREATE INDEX index_id_' || var_part_name || ' ON schema_docs.' || var_part_name || ' (id)'; END IF; IF var_node.index_docs_name THEN EXECUTE 'CREATE INDEX index_name_' || var_part_name || ' ON schema_docs.' || var_part_name || ' (name)'; END IF; END LOOP; FOR var_index IN SELECT * FROM schema_docs.nodes_indexes WHERE id_node = var_node.id LOOP var_path := schema_docs._path_to_array( var_index.path ); var_length_path_arr := array_length( var_path, 1 ); var_path_str := ''; FOR var_i_path IN 1..var_length_path_arr LOOP var_path_str := var_path_str || '->' || quote_literal( var_path[var_i_path] ); END LOOP; FOR var_i IN 1..var_max_tables LOOP var_part_name := 'docs_node_' || var_node.id || '_p_' || var_i; PERFORM schema_docs._set_user_index_create_exec( var_part_name, var_index.id, var_index.type_index, var_path_str ); END LOOP; END LOOP; UPDATE schema_docs.nodes SET count_in_partition = var_node.count_docs % p_partition_size, count_partition = var_max_tables, partition_size = p_partition_size WHERE id = var_node.id; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.set_node_partition_limit( p_node_id INT, p_partition_size INT ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._set_node_partition_limit( p_node_id, NULL, p_partition_size ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.set_node_partition_limit( p_node_path VARCHAR, p_partition_size INT ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._set_node_partition_limit( NULL, p_node_path, p_partition_size ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._set_node_index( p_node_id INT, p_node_path VARCHAR, p_index_id BOOLEAN, p_index_name BOOLEAN, p_val BOOLEAN ) RETURNS VOID AS $$ DECLARE var_node RECORD; var_i INT; var_part_name VARCHAR; BEGIN IF ( p_index_id IS NULL AND p_index_name IS NULL ) OR p_val IS NULL THEN RAISE EXCEPTION 'WRONG PARAMS'; END IF; var_node := schema_docs._get_node( p_node_id, p_node_path ); FOR var_i IN 1..var_node.count_partition LOOP var_part_name := 'docs_node_' || var_node.id || '_p_' || var_i; IF p_index_id IS NOT NULL THEN IF p_val AND var_node.index_docs_id = FALSE THEN EXECUTE 'CREATE INDEX index_id_' || var_part_name || ' ON schema_docs.' || var_part_name || ' (id)'; END IF; IF p_val = FALSE AND var_node.index_docs_id THEN EXECUTE 'DROP INDEX schema_docs.index_id_' || var_part_name; END IF; END IF; IF p_index_name IS NOT NULL THEN IF p_val AND var_node.index_docs_name = FALSE THEN EXECUTE 'CREATE INDEX index_name_' || var_part_name || ' ON schema_docs.' || var_part_name || ' (name)'; END IF; IF p_val = FALSE AND var_node.index_docs_name THEN EXECUTE 'DROP INDEX schema_docs.index_name_' || var_part_name; END IF; END IF; END LOOP; IF p_index_id IS NOT NULL THEN UPDATE schema_docs.nodes SET index_docs_id = p_val WHERE id = var_node.id; END IF; IF p_index_name IS NOT NULL THEN UPDATE schema_docs.nodes SET index_docs_name = p_val WHERE id = var_node.id; END IF; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.create_node_index_id( p_node_id INT ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._set_node_index( p_node_id, NULL, TRUE, NULL, TRUE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.create_node_index_id( p_node_path VARCHAR ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._set_node_index( NULL, p_node_path, TRUE, NULL, TRUE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.create_node_index_name( p_node_id INT ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._set_node_index( p_node_id, NULL, NULL, TRUE, TRUE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.create_node_index_name( p_node_path VARCHAR ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._set_node_index( NULL, p_node_path, NULL, TRUE, TRUE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.drop_node_index_id( p_node_id INT ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._set_node_index( p_node_id, NULL, TRUE, NULL, FALSE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.drop_node_index_id( p_node_path VARCHAR ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._set_node_index( NULL, p_node_path, TRUE, NULL, FALSE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.drop_node_index_name( p_node_path VARCHAR ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._set_node_index( NULL, p_node_path, NULL, TRUE, FALSE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.drop_node_index_name( p_node_id INT ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._set_node_index( p_node_id, NULL, NULL, TRUE, FALSE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._node_set_schema( p_node_id INT, p_node_path VARCHAR, p_data JSONB ) RETURNS VOID AS $$ DECLARE var_node RECORD; var_schema JSONB; BEGIN var_node := schema_docs._get_node( p_node_id, p_node_path ); IF p_data IS NULL THEN UPDATE schema_docs.nodes SET json_schema_save = null, json_schema_validate = null WHERE id = var_node.id; ELSE var_schema := schema_docs._build_parts_tpl_jsonb( schema_docs._build_tpl_jsonb( p_data ) ); UPDATE schema_docs.nodes SET json_schema_save = p_data, json_schema_validate = var_schema WHERE id = var_node.id; END IF; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.node_set_schema( p_node_id INT, p_data JSONB ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._node_set_schema( p_node_id, NULL, p_data ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.node_set_schema( p_node_path VARCHAR, p_data JSONB ) RETURNS VOID AS $$ BEGIN PERFORM schema_docs._node_set_schema( NULL, p_node_path, p_data ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._add_field_v( p_schema_validate jsonb, p_path varchar, p_data jsonb ) RETURNS void AS $$ BEGIN IF p_path = '' THEN RAISE EXCEPTION 'PATH IS BAD'; END IF; IF p_data IS NULL THEN RAISE EXCEPTION 'DATA IS NULL'; END IF; IF p_schema_validate IS NULL THEN RETURN; END IF; IF p_schema_validate->'data'->p_path IS NULL THEN RAISE EXCEPTION 'PATH NOT FOUND'; END IF; PERFORM schema_docs._validate_jsonb( p_schema_validate->'data'->p_path->'schema', p_data ); END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._add_field( p_node_id int, p_node_path VARCHAR, p_path varchar, p_data jsonb ) RETURNS void AS $$ DECLARE var_node RECORD; var_path_name text[] := schema_docs._path_to_array( p_path ); BEGIN var_node := schema_docs._get_node( p_node_id, p_node_path ); PERFORM schema_docs._add_field_v( var_node.json_schema_validate, replace( p_path, '//', '/' ), p_data ); UPDATE schema_docs.docs SET data = jsonb_set( data, var_path_name, p_data ) WHERE id_node = var_node.id AND ( data #> var_path_name[0: array_lower( var_path_name, 1 )-1] ) IS NOT NULL AND ( data #> var_path_name ) IS NULL; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.add_field( p_node_id int, p_path varchar, p_data jsonb ) RETURNS void AS $$ BEGIN PERFORM schema_docs._add_field( p_node_id, NULL, p_path, p_data ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.add_field( p_node_path VARCHAR, p_path varchar, p_data jsonb ) RETURNS void AS $$ BEGIN PERFORM schema_docs._add_field( NULL, p_node_path, p_path, p_data ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._remove_field_v( p_schema_validate jsonb, p_path varchar ) RETURNS void AS $$ BEGIN IF p_path = '' THEN RAISE EXCEPTION 'PATH IS BAD'; END IF; IF p_schema_validate IS NULL THEN RETURN; END IF; IF p_schema_validate->'data'->p_path IS NOT NULL AND ( p_schema_validate->'data'->p_path->'schema'->'r' IS NULL OR (p_schema_validate->'data'->p_path->'schema'->>'r')::BOOLEAN = TRUE ) THEN RAISE EXCEPTION 'PATH ISSET'; END IF; END; $$ LANGUAGE plpgsql IMMUTABLE; CREATE OR REPLACE FUNCTION schema_docs._remove_field( p_node_id int, p_node_path VARCHAR, p_path varchar ) RETURNS void AS $$ DECLARE var_node RECORD; var_path_name text[] := schema_docs._path_to_array( p_path ); BEGIN var_node := schema_docs._get_node( p_node_id, p_node_path ); PERFORM schema_docs._remove_field_v( var_node.json_schema_validate, replace( p_path, '//', '/' ) ); UPDATE schema_docs.docs SET data = data#-var_path_name WHERE id_node = var_node.id; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.remove_field( p_node_id int, p_path varchar ) RETURNS void AS $$ BEGIN PERFORM schema_docs._remove_field( p_node_id, NULL, p_path ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.remove_field( p_node_path VARCHAR, p_path varchar ) RETURNS void AS $$ BEGIN PERFORM schema_docs._remove_field( NULL, p_node_path, p_path ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._get_fields( p_node_id int, p_node_path VARCHAR ) RETURNS TEXT[] AS $$ DECLARE var_node RECORD; var_ret TEXT[]; BEGIN var_node := schema_docs._get_node( p_node_id, p_node_path ); SELECT array_agg( ret ) INTO var_ret FROM jsonb_object_keys( var_node.json_schema_validate->'data' ) as ret; RETURN var_ret; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.get_fields( p_node_id int ) RETURNS TEXT[] AS $$ BEGIN RETURN schema_docs._get_fields( p_node_id, NULL ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.get_fields( p_node_path VARCHAR ) RETURNS TEXT[] AS $$ BEGIN RETURN schema_docs._get_fields( NULL, p_node_path ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._set_user_index_create_exec( p_part_name VARCHAR, p_index_id INT, p_type INT, p_path VARCHAR ) RETURNS void AS $$ BEGIN IF p_type = 0 THEN EXECUTE 'CREATE INDEX index_' || p_part_name || '_u_' || p_type || '_' || p_index_id || ' ON schema_docs.' || p_part_name || ' ( (data' || p_path || ') )'; ELSIF p_type = 1 THEN EXECUTE 'CREATE INDEX index_' || p_part_name || '_u_' || p_type || '_' || p_index_id || ' ON schema_docs.' || p_part_name || ' USING GIN ( (data ' || p_path || ') )'; END IF; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._set_user_index_add( p_node_id INT, p_node_count_part INT, p_path TEXT[], p_path_str VARCHAR, p_type INT ) RETURNS void AS $$ DECLARE var_i INT; var_part_name VARCHAR; var_index_id INT; var_str VARCHAR; var_path_str VARCHAR := ''; var_i_path INT; var_length_path_arr INT := array_length( p_path, 1 ); BEGIN INSERT INTO schema_docs.nodes_indexes( id, id_node, path, type_index ) VALUES ( DEFAULT, p_node_id, p_path_str, p_type ) RETURNING id INTO var_index_id; FOR var_i_path IN 1..var_length_path_arr LOOP var_path_str := var_path_str || '->' || quote_literal( p_path[var_i_path] ); END LOOP; FOR var_i IN 1..p_node_count_part LOOP var_part_name := 'docs_node_' || p_node_id || '_p_' || var_i; PERFORM schema_docs._set_user_index_create_exec( var_part_name, var_index_id, p_type, var_path_str ); END LOOP; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._set_user_index_remove( p_node_id INT, p_index_id INT, p_node_count_part INT, p_type INT ) RETURNS void AS $$ DECLARE var_i INT; var_part_name VARCHAR; BEGIN FOR var_i IN 1..p_node_count_part LOOP var_part_name := 'docs_node_' || p_node_id || '_p_' || var_i; EXECUTE 'DROP INDEX schema_docs.index_' || var_part_name || '_u_' || p_type || '_' || p_index_id; END LOOP; DELETE FROM schema_docs.nodes_indexes WHERE id = p_index_id; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._set_user_index( p_node_id INT, p_node_path VARCHAR, p_path VARCHAR, p_type VARCHAR, p_add BOOLEAN ) RETURNS void AS $$ DECLARE var_node RECORD; var_path_arr TEXT[]; var_type VARCHAR; var_type_int INT; var_search_index_id INT; BEGIN IF p_add IS NULL OR ( p_path = '' OR p_path IS NULL ) THEN RAISE EXCEPTION 'WRONG PARAMS'; END IF; IF p_type IS NULL THEN var_type_int := 0; ELSE var_type := lower( p_type ); IF var_type = 'gin' THEN var_type_int := 1; ELSE RAISE EXCEPTION 'WRONG PARAMS'; END IF; END IF; var_node := schema_docs._get_node( p_node_id, p_node_path ); IF p_add THEN var_path_arr := schema_docs._path_to_array( p_path ); IF var_node.json_schema_validate IS NOT NULL AND var_node.json_schema_validate->'data'->p_path IS NULL THEN RAISE EXCEPTION 'PATH NOT FOUND'; END IF; SELECT id INTO var_search_index_id FROM schema_docs.nodes_indexes WHERE id_node = var_node.id AND type_index = var_type_int; IF var_search_index_id IS NOT NULL THEN RAISE EXCEPTION 'DUPLICATE INDEX'; END IF; PERFORM schema_docs._set_user_index_add( var_node.id, var_node.count_partition, var_path_arr, p_path, var_type_int ); ELSE SELECT id INTO var_search_index_id FROM schema_docs.nodes_indexes WHERE id_node = var_node.id AND path = p_path AND type_index = var_type_int; IF var_search_index_id IS NOT NULL THEN PERFORM schema_docs._set_user_index_remove( var_node.id, var_search_index_id, var_node.count_partition, var_type_int ); END IF; END IF; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.create_node_index( p_node_id INT, p_path VARCHAR, p_type VARCHAR = NULL ) RETURNS void AS $$ BEGIN PERFORM schema_docs._set_user_index( p_node_id, NULL, p_path, p_type, TRUE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.create_node_index( p_node_path VARCHAR, p_path VARCHAR, p_type VARCHAR = NULL ) RETURNS void AS $$ BEGIN PERFORM schema_docs._set_user_index( NULL, p_node_path, p_path, p_type, TRUE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.drop_node_index( p_node_id INT, p_path VARCHAR, p_type VARCHAR = NULL ) RETURNS void AS $$ BEGIN PERFORM schema_docs._set_user_index( p_node_id, NULL, p_path, p_type, FALSE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.drop_node_index( p_node_path VARCHAR, p_path VARCHAR, p_type VARCHAR = NULL ) RETURNS void AS $$ BEGIN PERFORM schema_docs._set_user_index( NULL, p_node_path, p_path, p_type, FALSE ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs._get_node_indexes( p_node_id INT, p_node_path VARCHAR ) RETURNS TABLE( path VARCHAR, type_index VARCHAR ) AS $$ DECLARE var_node RECORD; var_row RECORD; BEGIN var_node := schema_docs._get_node( p_node_id, p_node_path ); FOR var_row IN SELECT * FROM schema_docs.nodes_indexes WHERE id_node = var_node.id LOOP path := var_row.path; IF var_row.type_index = 0 THEN type_index := 'DEFAULT'; ELSIF var_row.type_index = 1 THEN type_index := 'GIN'; END IF; RETURN NEXT; END LOOP; END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.get_node_indexes( p_node_id INT ) RETURNS TABLE ( path VARCHAR, type_index VARCHAR ) AS $$ BEGIN RETURN QUERY SELECT * FROM schema_docs._get_node_indexes( p_node_id, NULL ); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION schema_docs.get_node_indexes( p_node_path VARCHAR ) RETURNS TABLE ( path VARCHAR, type_index VARCHAR ) AS $$ BEGIN RETURN QUERY SELECT * FROM schema_docs._get_node_indexes( NULL, p_node_path ); END; $$ LANGUAGE plpgsql; </pre> <script defer> function init() { var name = $( '.schema_name' ).val(); var html = $( 'pre' ).text(); html = html.replace( new RegExp( name+'\\.', 'g' ), '<span>'+name+'</span>.' ); html = html.replace( new RegExp( name+';', 'g' ), '<span>'+name+'</span>;' ); $( 'pre' ).html( html ); $( '.schema_name' ).on( 'input', function() { if( $( this ).val() == '' ) { $( 'pre span' ).html( name ); } else { $( 'pre span' ).html( $( this ).val() ); } }); } init(); // http://jsfiddle.net/zAZyy/ ;-) jQuery.fn.selectText = function(){ var doc = document; var element = this[0]; if (doc.body.createTextRange) { var range = document.body.createTextRange(); range.moveToElementText(element); range.select(); } else if (window.getSelection) { var selection = window.getSelection(); var range = document.createRange(); range.selectNodeContents(element); selection.removeAllRanges(); selection.addRange(range); } }; $( 'pre' ).on( 'click', function() { $( this ).selectText(); }); $( '[data-key]' ).on( 'mouseover', function() { var attr = $( this ).attr( 'data-key' ); if( attr != '' ) { $( '[data-key="'+attr+'"]' ).addClass( 'active_key' ); } }); $( '[data-key]' ).on( 'mouseout', function() { var attr = $( this ).attr( 'data-key' ); if( attr != '' ) { $( '[data-key="'+attr+'"]' ).removeClass( 'active_key' ); } }); $( '.title_exceptions' ).on( 'click', function() { if( $( this ).closest( 'tr' ).hasClass( 'exceptions_tr' ) ) { $( '.table_exceptions' ).hide(); $( '.exceptions_tr' ).removeClass( 'exceptions_tr' ); } else { $( '.table_exceptions' ).hide(); $( '.exceptions_tr' ).removeClass( 'exceptions_tr' ); $( this ).closest( 'td' ).find( '.table_exceptions' ).css( { display: 'table' } ); $( this ).closest( 'tr' ).addClass( 'exceptions_tr' ); } return false; }); $( '.table_exceptions' ).on( 'click', function() { return false; }); $( document ).on( 'click', function() { $( '.table_exceptions' ).hide(); $( '.exceptions_tr' ).removeClass( 'exceptions_tr' ); }); </script> </div> </body> </html>