{"id":253998,"date":"2015-03-28T18:44:02","date_gmt":"2015-03-28T14:44:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=253998"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=253998","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 PostgreSQL 9.4+"},"content":{"rendered":"<p>     \t\u041a\u0430\u043a \u043c\u043d\u043e\u0433\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0441\u044f \u0437\u043d\u0430\u044e\u0442, \u0432 PostgreSQL \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 9.4 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c (\u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e) \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f. \u0422\u0435\u043f\u0435\u0440\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e, \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 wal \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u044b (\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u043b\u0438 \u0435\u0449\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b), \u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0444\u043e\u0440\u043c\u0430\u0442. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u043a PostgreSQL, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u044d\u0442\u0438\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043b\u0430\u0433\u0438\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 JSON.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u041a\u043e\u0434 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435 \u2014 <a href=\"https:\/\/github.com\/ildus\/decoder_json\">github.com\/ildus\/decoder_json<\/a>. \u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0432\u0443\u044e\u0442\u0441\u044f pull-requests \u0441 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f\u043c\u0438 (\u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e \u0447\u0430\u0441\u0442\u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0442\u0438\u043f\u043e\u0432), \u0431\u0430\u0433\u0444\u0438\u043a\u0441\u0430\u043c\u0438 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u0441\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f\u043c\u0438. JSON \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u0437\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443. \u042d\u0442\u043e \u043d\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u043d\u0443\u0436\u0435\u043d \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442, \u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c.<\/p>\n<p>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430: \u0437\u043d\u0430\u043d\u0438\u0435 \u0421, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 (gcc, cmake), \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b (\u0432 debian-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445) postgresql-9.4, postgresql-server-dev-9.4 \u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445. \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 postgresql, \u0432 postgresql.conf \u043d\u0430\u0434\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 max_replication_slots = 1 (\u0438\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435) \u0438 wal_level = logical.<\/p>\n<p>  \u0421\u0430\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043d\u0430 C, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f callback \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f postgresql. \u041f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>_PG_output_plugin_init<\/code> \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439, \u043f\u043e\u043b\u044f\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043b\u044f\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<ul>\n<li>startup_cb \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430<\/li>\n<li>begin_cb \u2014 \u043d\u0430\u0447\u0430\u043b\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438<\/li>\n<li>change_cb \u2014 \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li>commit_cb \u2014 \u043f\u043e\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438<\/li>\n<li>shutdown_cb \u2014 \u0434\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430<\/li>\n<\/ul>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:<\/p>\n<pre><code>void _PG_output_plugin_init(OutputPluginCallbacks *cb) {     cb-&gt;startup_cb = decoder_json_startup;     cb-&gt;begin_cb = decoder_json_begin_txn;     cb-&gt;change_cb = decoder_json_change;     cb-&gt;commit_cb = decoder_json_commit_txn;     cb-&gt;shutdown_cb = decoder_json_shutdown; }<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u0438 \u043f\u044f\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0439. <code>decoder_json_startup<\/code> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043e\u043f\u0446\u0438\u0439 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u0430\u043c\u044f\u0442\u0438:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0443\u043d\u043a\u0446\u0438\u044f decoder_json_startup<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>\/* initialize this plugin *\/ static void decoder_json_startup(LogicalDecodingContext *ctx,                      OutputPluginOptions *opt,                      bool is_init) {     ListCell   *option;     DecoderRawData *data;      data = palloc(sizeof(DecoderRawData));     data-&gt;context = AllocSetContextCreate(ctx-&gt;context,                                           &quot;Raw decoder context&quot;,                                           ALLOCSET_DEFAULT_MINSIZE,                                           ALLOCSET_DEFAULT_INITSIZE,                                           ALLOCSET_DEFAULT_MAXSIZE);     data-&gt;include_transaction = false;     data-&gt;sort_keys = false;      ctx-&gt;output_plugin_private = data;      \/* Default output format *\/     opt-&gt;output_type = OUTPUT_PLUGIN_TEXTUAL_OUTPUT;      foreach(option, ctx-&gt;output_plugin_options)     {         DefElem    *elem = lfirst(option);          Assert(elem-&gt;arg == NULL || IsA(elem-&gt;arg, String));          if (strcmp(elem-&gt;defname, &quot;include_transaction&quot;) == 0)         {             \/* if option does not provide a value, it means its value is true *\/             if (elem-&gt;arg == NULL)                 data-&gt;include_transaction = true;             else if (!parse_bool(strVal(elem-&gt;arg), &amp;data-&gt;include_transaction))                 ereport(ERROR,                         (errcode(ERRCODE_INVALID_PARAMETER_VALUE),                          errmsg(&quot;could not parse value \\&quot;%s\\&quot; for parameter \\&quot;%s\\&quot;&quot;,                                 strVal(elem-&gt;arg), elem-&gt;defname)));         }         else if (strcmp(elem-&gt;defname, &quot;sort_keys&quot;) == 0) {             \/* if option does not provide a value, it means its value is true *\/             if (elem-&gt;arg == NULL)                 data-&gt;sort_keys = true;             else if (!parse_bool(strVal(elem-&gt;arg), &amp;data-&gt;sort_keys))                 ereport(ERROR,                         (errcode(ERRCODE_INVALID_PARAMETER_VALUE),                          errmsg(&quot;could not parse value \\&quot;%s\\&quot; for parameter \\&quot;%s\\&quot;&quot;,                                 strVal(elem-&gt;arg), elem-&gt;defname)));         }         else         {             ereport(ERROR,                     (errcode(ERRCODE_INVALID_PARAMETER_VALUE),                      errmsg(&quot;option \\&quot;%s\\&quot; = \\&quot;%s\\&quot; is unknown&quot;,                             elem-&gt;defname,                             elem-&gt;arg ? strVal(elem-&gt;arg) : &quot;(null)&quot;)));         }     } }<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043f\u0430\u0440\u0441\u044f\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043c \u0432 <code>decoder_json_change<\/code> \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u043f\u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b. \u0412\u0430\u0436\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\u0441\u0432\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0432 ctx-&gt;output_plugin_private<\/li>\n<li><code>opt-&gt;output_type = OUTPUT_PLUGIN_TEXTUAL_OUTPUT<\/code> \u2014 \u0442\u0430\u043a \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e \u0432\u044b\u0432\u043e\u0434 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0439<\/li>\n<\/ul>\n<p>  <code>decoder_json_shutdown<\/code> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0446\u0435 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0447\u0438\u0441\u0442\u043a\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u0443\u043d\u043a\u0446\u0438\u044f decoder_json_shutdown<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>\/* cleanup this plugin's resources *\/ static void decoder_json_shutdown(LogicalDecodingContext *ctx) {     DecoderRawData *data = ctx-&gt;output_plugin_private;      \/* cleanup our own resources via memory context reset *\/     MemoryContextDelete(data-&gt;context); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u041d\u0430\u0434\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>decoder_json_begin_txn<\/code>, <code>decoder_json_commit_txn<\/code> \u0438 <code>decoder_json_change<\/code> \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442 \u0441\u0442\u0440\u043e\u043a\u0438, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 <code>pg_logical_slot_peek_changes<\/code> \u0438 <code>pg_logical_slot_get_changes<\/code>. \u0421\u0433\u0435\u043d\u0435\u0440\u0435\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0441\u043b\u043e\u0442, \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438:<\/p>\n<pre><code>OutputPluginPrepareWrite(ctx, true); appendStringInfoString(ctx-&gt;out, &quot;some string&quot;); OutputPluginWrite(ctx, true); <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u0438 <code>decoder_json_begin_txn<\/code> \u0438 <code>decoder_json_commit_txn<\/code> \u043f\u0438\u0448\u0443\u0442 (\u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u044e\u0442, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435) \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430\u0447\u0430\u043b\u0430 \u0438 \u043a\u043e\u043d\u0446\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0432 \u0441\u043b\u043e\u0442 \u2014 \u0441\u0442\u0440\u043e\u043a\u0438 &#8216;begin&#8217; \u0438 &#8216;commit&#8217; \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>decoder_json_change<\/code> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e (INSERT, UPDATE, DELETE) \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043d\u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430. \u0414\u043b\u044f UPDATE \u0438 DELETE \u0432\u0430\u0436\u043d\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e (not null) \u0438\u043b\u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435, \u0438\u043d\u0430\u0447\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u0443\u044e (\u0443\u0434\u0430\u043b\u044f\u0435\u043c\u0443\u044e) \u0441\u0442\u0440\u043e\u043a\u0443. \u042d\u0442\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 REPLICA IDENTITY \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<p>  \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 4 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:<\/p>\n<ul>\n<li>LogicalDecodingContext *ctx \u2014 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442<\/li>\n<li>ReorderBufferTXN *txn<\/li>\n<li>Relation relation \u2014 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435<\/li>\n<li>ReorderBufferChange *change \u2014 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<\/ul>\n<p>  \u041a\u0440\u0430\u0442\u043a\u043e \u043f\u0440\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0442\u043e \u0442\u0438\u043f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <code>change-&gt;action<\/code>. \u0414\u0430\u043b\u0435\u0435 \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u0432 <code>change<\/code> (<code>change-&gt;data.tp.newtuple<\/code> \u0438 <code>change-&gt;data.tp.oldtuple<\/code>) \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f JSON \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430. JSON \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 libjansson.<\/p>\n<p>  \u0412\u043e\u0442 \u0437\u0434\u0435\u0441\u044c \u0442\u043e \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u0415\u0441\u043b\u0438 REPLICA IDENTITY \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432 NOTHING \u0438\u043b\u0438 DEFAULT \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u043c \u043a\u043b\u044e\u0447\u0435, \u0442\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0432 \u043b\u043e\u0433 \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u041f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 DEFAULT, FULL, INDEX \u0438 \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430, \u0442\u043e \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438\u0437 newtuple \u0438\u043b\u0438 \u0438\u0437 oldtuple (\u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c). \u041f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u0438 \u0435\u0441\u043b\u0438 FULL, \u0442\u043e \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 oldtuple.<\/p>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f JSON \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0432\u0438\u0434\u0430 <code>{&quot;a&quot;: 0, &quot;r&quot;: &quot;public.some_table&quot;, &quot;c&quot;: {&quot;id&quot;: 1}, &quot;d&quot;: {&quot;a&quot;: 2}}<\/code>, \u0433\u0434\u0435 a \u2014 \u044d\u0442\u043e \u0442\u0438\u043f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, r \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, c \u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u0442\u0440\u043e\u043a\u0438, d \u2014 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443. \u0421\u0431\u043e\u0440\u043a\u0430 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432:<\/p>\n<pre><code class=\"bash\">git clone https:\/\/github.com\/ildus\/decoder_json.git cd decoder_json # \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0432\u0441\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u043f\u043e\u0441\u0442\u0433\u0440\u0435\u0441\u0430 - \u043d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 sudo chmod a+rw `pg_config --pkglibdir` chmod a+rwx .\/ # \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c libjansson, \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 JSON make deps  # \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u0434 \u044e\u0437\u0435\u0440\u0430 postgres sudo su postgres make make test <\/code><\/pre>\n<p>  \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0432\u0440\u0443\u0447\u043d\u0443\u044e:<\/p>\n<pre><code># \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u0434 \u044e\u0437\u0435\u0440\u0430 postgres, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0431\u0434 \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0434 sudo su postgres createdb test_db psql test_db  # psql \u043a\u043e\u043d\u0441\u043e\u043b\u044c test_db=# create table test1 (id serial primary key, name varchar); test_db=# SELECT * FROM pg_create_logical_replication_slot(&#39;custom_slot&#39;, &#39;decoder_json&#39;);   slot_name  | xlog_position  -------------+---------------  custom_slot | 0\/4D9F870 (1 row) <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0442\u0430 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0439 \u043f\u043b\u0430\u0433\u0438\u043d. \u0412 \u043e\u0442\u0432\u0435\u0442\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0442\u0430, \u0438 \u043c\u0435\u0441\u0442\u043e (xlog \u043f\u043e\u0437\u0438\u0446\u0438\u044f) \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u043b\u043e\u0442. \u0422\u043e \u0447\u0442\u043e \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u043d\u0430\u0448 \u043f\u043b\u0430\u0433\u0438\u043d, \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0447\u0442\u043e \u043e\u043d \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0441\u0430\u043c\u043e \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>pg_logical_slot_peek_changes<\/code> \u0438 <code>pg_logical_slot_get_changes<\/code>. \u041e\u043d\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u0435\u043c \u0447\u0442\u043e get \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0438\u0441\u0442\u0438\u0442 \u043e\u0447\u0435\u0440\u0435\u0434\u044c.<\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code>test_db=# insert into test1 values (1, &#39;bb&#39;); INSERT 0 1 test_db=# insert into test1 values (2, &#39;bb&#39;); INSERT 0 1 test_db=# select * from pg_logical_slot_get_changes(&#39;custom_slot&#39;, NULL, NULL, &#39;include_transaction&#39;, &#39;on&#39;);  location  |  xid  |                        data                          -----------+-------+-----------------------------------------------------  0\/BAB0968 | 48328 | begin  0\/BAB0968 | 48328 | {&quot;a&quot;:0,&quot;r&quot;:&quot;public.test1&quot;,&quot;d&quot;:{&quot;id&quot;:1,&quot;name&quot;:&quot;bb&quot;}}  0\/BAB09F0 | 48328 | commit  0\/BAB09F0 | 48329 | begin  0\/BAB09F0 | 48329 | {&quot;a&quot;:0,&quot;r&quot;:&quot;public.test1&quot;,&quot;d&quot;:{&quot;id&quot;:2,&quot;name&quot;:&quot;bb&quot;}}  0\/BAB0A78 | 48329 | commit (6 rows)<\/code><\/pre>\n<p>  \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<pre><code>test_db=# update test1 set name = &#39;dd&#39; where id=2; UPDATE 1 test_db=# select * from pg_logical_slot_get_changes(&#39;custom_slot&#39;, NULL, NULL, &#39;include_transaction&#39;, &#39;on&#39;);  location  |  xid  |                               data                                -----------+-------+------------------------------------------------------------------  0\/BB4C700 | 48338 | begin  0\/BB4C700 | 48338 | {&quot;c&quot;:{&quot;id&quot;:2},&quot;a&quot;:1,&quot;r&quot;:&quot;public.test1&quot;,&quot;d&quot;:{&quot;id&quot;:2,&quot;name&quot;:&quot;dd&quot;}}  0\/BB4C798 | 48338 | commit (3 rows)<\/code><\/pre>\n<p>  \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code>test_db=# delete from test1 where id=2; DELETE 1 test_db=# select * from pg_logical_slot_get_changes(&#39;custom_slot&#39;, NULL, NULL, &#39;include_transaction&#39;, &#39;on&#39;);  location  |  xid  |                  data                    -----------+-------+-----------------------------------------  0\/BB4C8A8 | 48339 | begin  0\/BB4C8A8 | 48339 | {&quot;c&quot;:{&quot;id&quot;:2},&quot;a&quot;:2,&quot;r&quot;:&quot;public.test1&quot;}  0\/BB4C9C8 | 48339 | commit (3 rows) <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b:<\/p>\n<ul>\n<li>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f PostgresqlSQL \u2014 <a href=\"http:\/\/www.postgresql.org\/docs\/9.4\/static\/logicaldecoding.html\">www.postgresql.org\/docs\/9.4\/static\/logicaldecoding.html<\/a><\/li>\n<li>\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0438\u0437 PostgreSQL (https:\/\/github.com\/postgres\/postgres\/tree\/master\/contrib\/test_decoding)<\/li>\n<li><a href=\"http:\/\/michael.otacoo.com\/\">michael.otacoo.com\/<\/a> \u2014 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0431\u043b\u043e\u0433, \u043f\u043b\u0430\u0433\u0438\u043d decoder_raw \u0430\u0432\u0442\u043e\u0440\u0430 \u044d\u0442\u043e\u0433\u043e \u0431\u043b\u043e\u0433\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043a\u0430\u043a \u043e\u0441\u043d\u043e\u0432\u0430 \u0434\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430.<\/li>\n<li><a href=\"https:\/\/github.com\/xstevens\/decoderbufs\">github.com\/xstevens\/decoderbufs<\/a> \u2014 \u043f\u043b\u0430\u0433\u0438\u043d \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 google protocol buffers \u043a\u0430\u043a \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442.<\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/254263\/\"> http:\/\/habrahabr.ru\/post\/254263\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u041a\u0430\u043a \u043c\u043d\u043e\u0433\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0441\u044f \u0437\u043d\u0430\u044e\u0442, \u0432 PostgreSQL \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 9.4 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c (\u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e) \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f. \u0422\u0435\u043f\u0435\u0440\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e, \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 wal \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u044b (\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u043b\u0438 \u0435\u0449\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b), \u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0444\u043e\u0440\u043c\u0430\u0442. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u043a PostgreSQL, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u044d\u0442\u0438\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043b\u0430\u0433\u0438\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 JSON.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-253998","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/253998","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=253998"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/253998\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=253998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=253998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=253998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}