{"id":38232,"date":"2019-10-31T22:22:28","date_gmt":"2019-10-31T19:22:28","guid":{"rendered":"https:\/\/prohoster.info\/blog\/odin-iz-metodov-polucheniya-istorii-blokirovok-v-postgresql\/"},"modified":"2019-10-31T22:22:28","modified_gmt":"2019-10-31T19:22:28","slug":"odin-iz-metodov-polucheniya-istorii-blokirovok-v-postgresql","status":"publish","type":"post","link":"https:\/\/prohoster.info\/sv\/blog\/administrirovanie\/odin-iz-metodov-polucheniya-istorii-blokirovok-v-postgresql","title":{"rendered":"En av metoderna f\u00f6r att f\u00e5 l\u00e5s historik i PostgreSQL","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Forts\u00e4ttning p\u00e5 artikeln &#171;<noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/467181\/\">Ett f\u00f6rs\u00f6k att skapa en analog till ASH f\u00f6r PostgreSQL <\/a><\/noindex>&#171;.<\/p>\n<p>Artikeln kommer att granska och visa med konkreta fraser och exempel vilken anv\u00e4ndbar information som kan erh\u00e5llas genom visningen av pg_locks.<\/p>\n<blockquote><p>Varning.<br \/>\nP\u00e5 grund av \u00e4mnets nyhet och det ofullst\u00e4ndiga testperioden kan artikeln inneh\u00e5lla fel. Kritik och kommentarer v\u00e4lkomnas och f\u00f6rv\u00e4ntas.<\/p><\/blockquote>\n<p><noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h2>Indata<\/h2>\n<p><\/p>\n<h3>Historik \u00f6ver visningen pg_locks<\/h3>\n<p>\n<b class=\"spoiler_title\">archive_locking<\/b><\/p>\n<pre><code class=\"pgsql\">CREATE TABLE archive_locking \n(       timepoint timestamp without time zone ,\n\tlocktype text ,\n\trelation oid ,\n\tmode text ,\n\ttid xid ,\n\tvtid text ,\n\tpid integer ,\n\tblocking_pids integer[] ,\n\tgranted boolean ,\n        queryid bigint \n);<\/code><\/pre>\n<p>\nI grunden \u00e4r tabellen liknande tabellen <b>archive_pg_stat_activity<\/b>, som beskrivs mer detaljerat h\u00e4r \u2014 <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/467277\/\">pg_stat_statements + pg_stat_activity + loq_query = pg_ash? <\/a><\/noindex> och h\u00e4r \u2014 <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/467181\/\">Ett f\u00f6rs\u00f6k att skapa en analog till ASH f\u00f6r PostgreSQL.<\/a><\/noindex><\/p>\n<p>F\u00f6r att fylla i kolumnen <b>queryid<\/b> anv\u00e4nds funktionen <\/p>\n<p><b class=\"spoiler_title\">update_history_locking_by_queryid<\/b><\/p>\n<pre><code class=\"pgsql\">--update_history_locking_by_queryid.sql\nCREATE OR REPLACE FUNCTION update_history_locking_by_queryid() RETURNS boolean AS $$\nDECLARE\n  result boolean ;\n  current_minute double precision ; \n  \n  start_minute integer ;\n  finish_minute integer ;\n  \n  start_period timestamp without time zone ;\n  finish_period timestamp without time zone ;\n  \n  lock_rec record ; \n  endpoint_rec record ; \n  \n  current_hour_diff double precision ;\nBEGIN\n  RAISE NOTICE '***update_history_locking_by_queryid';\n  \n  result = TRUE ;\n  \n  current_minute = extract ( minute from now() );\n\n  SELECT * FROM endpoint WHERE is_need_monitoring\n  INTO endpoint_rec ;\n  \n  current_hour_diff = endpoint_rec.hour_diff ;\n  \n  IF current_minute &lt; 5 \n  THEN\n\tRAISE NOTICE &#039;Current time is less than 5 minute.&#039;;\n\t\n\tstart_period = date_trunc(&#039;hour&#039;,now()) + (current_hour_diff * interval &#039;1 hour&#039;);\n    finish_period = start_period - interval &#039;5 minute&#039; ;\n  ELSE \n    finish_minute =  extract ( minute from now() ) \/ 5 ;\n    start_minute =  finish_minute - 1 ;\n  \n    start_period = date_trunc(&#039;hour&#039;,now()) + interval &#039;1 minute&#039;*start_minute*5+(current_hour_diff * interval &#039;1 hour&#039;);\n    finish_period = date_trunc(&#039;hour&#039;,now()) + interval &#039;1 minute&#039;*finish_minute*5+(current_hour_diff * interval &#039;1 hour&#039;) ;\n    \n  END IF ;  \n  \n  RAISE NOTICE &#039;start_period = %&#039;, start_period;\n  RAISE NOTICE &#039;finish_period = %&#039;, finish_period;\n\n\tFOR lock_rec IN   \n\tWITH act_queryid AS\n\t (\n\t\tSELECT \n\t\t\t\tpid , \n\t\t\t\ttimepoint ,\n\t\t\t\tquery_start AS started ,\t\t\t\n\t\t\t\tMAX(timepoint) OVER (PARTITION BY pid ,\tquery_start   ) AS finished ,\t\t\t\n\t\t\t\tqueryid \n\t\tFROM \n\t\t\t\tactivity_hist.history_pg_stat_activity \t\t\t\n\t\tWHERE \t\t\t\n\t\t\t\ttimepoint BETWEEN start_period and \n\t\t\t\t\t\t\t\t  finish_period\n\t\tGROUP BY \n\t\t\t\tpid , \n\t\t\t\ttimepoint ,  \n\t\t\t\tquery_start ,\n\t\t\t\tqueryid \n\t ),\n\t lock_pids AS\n\t\t(\n\t\t\tSELECT\n\t\t\t\thl.pid , \n\t\t\t\thl.locktype  ,\n\t\t\t\thl.mode ,\n\t\t\t\thl.timepoint , \n\t\t\t\tMIN ( timepoint ) OVER (PARTITION BY pid , locktype  ,mode ) as started \n\t\t\tFROM \n\t\t\t\tactivity_hist.history_locking hl\n\t\t\tWHERE \n\t\t\t\thl.timepoint between start_period and \n\t\t\t\t\t\t\t\t     finish_period\n\t\t\tGROUP BY \n\t\t\t\thl.pid , \n\t\t\t\thl.locktype  ,\n\t\t\t\thl.mode ,\n\t\t\t\thl.timepoint \n\t\t)\n\tSELECT \n\t\tlp.pid , \n\t\tlp.locktype  ,\n\t\tlp.mode ,\n\t\tlp.timepoint ,     \n\t\taq.queryid \n\tFROM lock_pids \tlp LEFT OUTER JOIN act_queryid aq ON ( lp.pid = aq.pid AND lp.started BETWEEN aq.started AND aq.finished )\n\tWHERE aq.queryid IS NOT NULL \n\tGROUP BY  \n\t\tlp.pid , \n\t\tlp.locktype  ,\n\t\tlp.mode ,\n\t\tlp.timepoint , \n\t\taq.queryid\n\tLOOP\n\t\tUPDATE activity_hist.history_locking SET queryid = lock_rec.queryid \n\t\tWHERE pid = lock_rec.pid AND locktype = lock_rec.locktype AND mode = lock_rec.mode AND timepoint = lock_rec.timepoint ;\t\n\tEND LOOP;    \n  \n  RETURN result ;\nEND\n$$ LANGUAGE plpgsql;<\/code><\/pre>\n<p>\n<b>F\u00f6rklaring:<\/b> V\u00e4rdet i kolumnen queryid uppdateras i tabellen history_locking, och n\u00e4r en ny sektion f\u00f6r tabellen archive_locking skapas, kommer v\u00e4rdet att sparas i de historiska v\u00e4rdena. <\/p>\n<h2>Utdata<\/h2>\n<p>\n\u00d6versikt \u00f6ver processerna som helhet.<\/p>\n<h3>V\u00c4NTAR P\u00c5 L\u00c5SNINGAR ENLIGA L\u00c5STYPER<\/h3>\n<p>\n<b class=\"spoiler_title\">Fr\u00e5ga<\/b><\/p>\n<pre><code class=\"pgsql\">WITH\nt AS\n(\n\tSELECT \n\t\tlocktype  ,\n\t\tmode ,\n\t\tcount(*) as total \n\tFROM \n\t\tactivity_hist.archive_locking\n\tWHERE \n\t\ttimepoint between pg_stat_history_begin+(current_hour_diff * interval '1 hour') AND pg_stat_history_end+(current_hour_diff * interval '1 hour') AND \n\t\tNOT granted\n\tGROUP BY \n\t\tlocktype  ,\n\t\tmode  \n)\nSELECT \n\tlocktype  ,\n\tmode ,\n\ttotal * interval '1 second' as duration\t\t\t\nFROM t \t\t\nORDER BY 3 DESC <\/code><\/pre>\n<p>\n<b class=\"spoiler_title\">Exempel<\/b><\/p>\n<pre>| V\u00c4NTAR P\u00c5 L\u00c5S PER L\u00c5STYP\n+--------------------+------------------------------+--------------------\n|            l\u00e5styp|                          l\u00e4ge|            varaktighet\n+--------------------+------------------------------+--------------------\n|       transaktionsid|                     DelaL\u00e5s|            19:39:26\n|               tuple|           \u00c5tkomstExklusivL\u00e5s|            00:03:35\n+--------------------+------------------------------+--------------------\n<\/pre>\n<p><\/p>\n<h3>TAGNINGAR AV L\u00c5S PER L\u00c5STYP<\/h3>\n<p>\n<b class=\"spoiler_title\">Fr\u00e5ga<\/b><\/p>\n<pre><code class=\"pgsql\">MED\nt AS\n(\n\tV\u00c4LJ \n\t\tl\u00e5styp  ,\n\t\tl\u00e4ge ,\n\t\tantal(*) som totalt \n\tFR\u00c5N \n\t\tactivity_hist.archive_locking\n\tD\u00c4R \n\t\ttidpunkt mellan pg_stat_history_begin+(current_hour_diff * intervall '1 timme') OCH pg_stat_history_end+(current_hour_diff * intervall '1 timme') OCH \n\t\ttilldelat\n\tGRUPPERA EFTER \n\t\tl\u00e5styp  ,\n\t\tl\u00e4ge  \n)\nV\u00c4LJ \n\tl\u00e5styp  ,\n\tl\u00e4ge ,\n\ttotalt * intervall '1 sekund' som varaktighet\t\t\t\nFR\u00c5N t \t\t\nORDNA EFTER 3 DESC <\/code><\/pre>\n<p>\n<b class=\"spoiler_title\">Exempel<\/b><\/p>\n<pre>| TAGNINGAR AV L\u00c5S PER L\u00c5STYP\n+--------------------+------------------------------+--------------------\n|            l\u00e5styp|                          l\u00e4ge|            varaktighet\n+--------------------+------------------------------+--------------------\n|            relation|              RadExklusivL\u00e5s|            51:11:10\n|          virtualxid|                 ExklusivL\u00e5s|            48:10:43\n|       transaktionsid|                 ExklusivL\u00e5s|            44:24:53\n|            relation|               \u00c5tkomstDelaL\u00e5s|            20:06:13\n|               tuple|           \u00c5tkomstExklusivL\u00e5s|            17:58:47\n|               tuple|                 ExklusivL\u00e5s|            01:40:41\n|            relation|      DelaUppdateraExklusivL\u00e5s|            00:26:41\n|              objekt|              RadExklusivL\u00e5s|            00:00:01\n|       transaktionsid|                     DelaL\u00e5s|            00:00:01\n|              extend|                 ExklusivL\u00e5s|            00:00:01\n+--------------------+------------------------------+--------------------\n<\/pre>\n<p>\nDetaljerad information om specifika queryid-fr\u00e5gor<\/p>\n<h3>V\u00c4NTAR P\u00c5 L\u00c5S PER L\u00c5STYP PER QUERYID<\/h3>\n<p>\n<b class=\"spoiler_title\">Fr\u00e5ga<\/b><\/p>\n<pre><code class=\"pgsql\">MED\nlt AS\n(\n\tV\u00c4LJ\n\t\tpid , \n\t\tl\u00e5styp  ,\n\t\tl\u00e4ge ,\n\t\ttidpunkt , \n\t\tqueryid , \n\t\tblockerande_pid ,\n                MIN ( tidpunkt ) \u00d6VER (PARTITION BY pid , l\u00e5styp  ,l\u00e4ge ) som startad  \n\tFR\u00c5N \n\t\tactivity_hist.archive_locking\n\tD\u00c4R \n\t\ttidpunkt mellan pg_stat_history_begin+(current_hour_diff * intervall '1 timme') OCH \n\t\t\t                  pg_stat_history_end+(current_hour_diff * intervall '1 timme') OCH \n\t\tIKKE tilldelat OCH\n\t       queryid \u00c4R INTE NULL \n\tGRUPPERA EFTER \n\t        pid , \n\t\tl\u00e5styp  ,\n\t\tl\u00e4ge ,\n\t\ttidpunkt ,\n\t\tqueryid ,\n\t\tblockerande_pid \n)\nV\u00c4LJ \n        lt.pid , \n\tlt.l\u00e5styp  ,\n\tlt.l\u00e4ge ,\t\t\t\n        lt.startad ,\n\tlt.queryid  ,\n\tlt.blockerande_pid ,\n\tANTAL(*)  * intervall '1 sekund'\t som varaktighet\t\t\nFR\u00c5N lt \t\nGRUPPERA EFTER \n\tlt.pid , \n        lt.l\u00e5styp  ,\n\tlt.l\u00e4ge ,\t\t\t\n        lt.startad ,\n        lt.queryid ,\n\tlt.blockerande_pid \nORDNA EFTER 4<\/code><\/pre>\n<p>\n<b class=\"spoiler_title\">Exempel<\/b><\/p>\n<pre>| V\u00c4NTAR P\u00c5 L\u00c5S EFTER L\u00c5STYPER EFTER FR\u00c5GE-ID\n+----------+-------------------------+--------------------+------------------------------+--------------------+--------------------+--------------------\n|       pid|                 l\u00e5styp|                l\u00e4ge|                       startad|             fr\u00e5gaid|       blockering_pid|            varaktighet\n+----------+-------------------------+--------------------+------------------------------+--------------------+--------------------+--------------------\n|     11288|            transaktionsid|           ShareLock|    2019-09-17 10:00:00.302936|  389015618226997618|             {11092}|            00:03:34\n|     11626|            transaktionsid|           ShareLock|    2019-09-17 10:00:21.380921|  389015618226997618|             {12380}|            00:00:29\n|     11626|            transaktionsid|           ShareLock|    2019-09-17 10:00:21.380921|  389015618226997618|             {11092}|            00:03:25\n|     11626|            transaktionsid|           ShareLock|    2019-09-17 10:00:21.380921|  389015618226997618|             {12213}|            00:01:55\n|     11626|            transaktionsid|           ShareLock|    2019-09-17 10:00:21.380921|  389015618226997618|             {12751}|            00:00:01\n|     11629|            transaktionsid|           ShareLock|    2019-09-17 10:00:24.331935|  389015618226997618|             {11092}|            00:03:22\n|     11629|            transaktionsid|           ShareLock|    2019-09-17 10:00:24.331935|  389015618226997618|             {12007}|            00:00:01\n|     12007|            transaktionsid|           ShareLock|    2019-09-17 10:05:03.327933|  389015618226997618|             {11629}|            00:00:13\n|     12007|            transaktionsid|           ShareLock|    2019-09-17 10:05:03.327933|  389015618226997618|             {11092}|            00:01:10\n|     12007|            transaktionsid|           ShareLock|    2019-09-17 10:05:03.327933|  389015618226997618|             {11288}|            00:00:05\n|     12213|            transaktionsid|           ShareLock|    2019-09-17 10:06:07.328019|  389015618226997618|             {12007}|            00:00:10<\/pre>\n<p><\/p>\n<h3>TAR L\u00c5SAR EFTER L\u00c5STYPER EFTER FR\u00c5GE-ID<\/h3>\n<p>\n<b class=\"spoiler_title\">Fr\u00e5ga<\/b><\/p>\n<pre><code class=\"pgsql\">MED\nlt SOM\n(\n\tV\u00c4LJ\n\t\tpid , \n\t\tl\u00e5styp  ,\n\t\tl\u00e4ge ,\n\t\ttidpunkt , \n\t\tfr\u00e5ge-id , \n\t\tblockering_pid ,\n                MIN ( tidpunkt ) \u00d6VER (PARTITION BY pid , l\u00e5styp  ,l\u00e4ge ) som startad  \n\tFR\u00c5N \n\t\taktivitet_hist.archive_locking\n\tD\u00c4R \n\t\ttidpunkt mellan pg_stat_history_begin+(current_hour_diff * intervall '1 timme') OCH \n\t\t\t                  pg_stat_history_end+(current_hour_diff * intervall '1 timme') OCH \n\t\tbeviljad OCH\n\t\tfr\u00e5ge-id \u00c4R INTE NULL \n\tGROUP BY \n\t        pid , \n\t\tl\u00e5styp  ,\n\t\tl\u00e4ge ,\n\t\ttidpunkt ,\n\t\tfr\u00e5ge-id ,\n\t\tblockering_pid \n)\nV\u00c4LJ \n        lt.pid , \n\tlt.l\u00e5styp  ,\n\tlt.l\u00e4ge ,\t\t\t\n        lt.startad ,\n\tlt.fr\u00e5ge-id  ,\n\tlt.blockering_pid ,\n\tCOUNT(*)  * intervall '1 sekund'\t som varaktighet\t\t\t\nFR\u00c5N lt \t\nGROUP BY \n\tlt.pid , \n\tlt.l\u00e5styp  ,\n\tlt.l\u00e4ge ,\t\t\t\n        lt.startad ,\n\tlt.fr\u00e5ge-id ,\n\tlt.blockering_pid \nORDER BY 4<\/code><\/pre>\n<p>\n<b class=\"spoiler_title\">Exempel<\/b><\/p>\n<pre>| TAGNING AV L\u00c5S GENOM L\u00c5STYPER GENOM QUERYID\n+----------+-------------------------+--------------------+------------------------------+--------------------+--------------------+--------------------\n|       pid|                 l\u00e5styp|                l\u00e4ge|                       startad|             queryid|       blockerande_pids|            varaktighet\n+----------+-------------------------+--------------------+------------------------------+--------------------+--------------------+--------------------\n|     11288|                 relation|    RadExklusivtL\u00e5s|    2019-09-17 10:00:00.302936|  389015618226997618|             {11092}|            00:03:34\n|     11092|            transaktionsid|       ExklusivtL\u00e5s|    2019-09-17 10:00:00.302936|  389015618226997618|                  {}|            00:03:34\n|     11288|                 relation|    RadExklusivtL\u00e5s|    2019-09-17 10:00:00.302936|  389015618226997618|                  {}|            00:00:10\n|     11092|                 relation|    RadExklusivtL\u00e5s|    2019-09-17 10:00:00.302936|  389015618226997618|                  {}|            00:03:34\n|     11092|               virtualxid|       ExklusivtL\u00e5s|    2019-09-17 10:00:00.302936|  389015618226997618|                  {}|            00:03:34\n|     11288|               virtualxid|       ExklusivtL\u00e5s|    2019-09-17 10:00:00.302936|  389015618226997618|             {11092}|            00:03:34\n|     11288|            transaktionsid|       ExklusivtL\u00e5s|    2019-09-17 10:00:00.302936|  389015618226997618|             {11092}|            00:03:34\n|     11288|                    tuple| \u00c5tkomstExklusivtL\u00e5s|    2019-09-17 10:00:00.302936|  389015618226997618|             {11092}|            00:03:34<\/pre>\n<p>\n<b>Anv\u00e4ndning av l\u00e5shistorik vid analys av prestandaincidenter.<\/b><\/p>\n<ol>\n<li>F\u00f6rfr\u00e5gan med queryid=389015618226997618 utf\u00f6rd av processen med pid=11288 v\u00e4ntade p\u00e5 l\u00e5s sedan 2019-09-17 10:00:00 i 3 minuter.<\/li>\n<li>L\u00e5set h\u00f6lls av processen med pid=11092.<\/li>\n<li>Processen med pid=11092, som utf\u00f6rde f\u00f6rfr\u00e5gan med queryid=389015618226997618 sedan 2019-09-17 10:00:00, h\u00f6ll l\u00e5set i 3 minuter.<\/li>\n<\/ol>\n<p><\/p>\n<h2>Resultat<\/h2>\n<p>\nNu hoppas jag att det mest intressanta och nyttiga b\u00f6rjar - insamlingen av statistik och analys av fall baserade p\u00e5 v\u00e4ntetider och l\u00e5shistorik. <\/p>\n<p>I framtiden hoppas jag att det blir en upps\u00e4ttning av n\u00e5got som en note (i likhet med metall\u00e4nken i Oracle).<\/p>\n<p>Det \u00e4r egentligen av denna anledning som den anv\u00e4nda metoden snabbt g\u00f6rs tillg\u00e4nglig f\u00f6r allm\u00e4nheten.<\/p>\n<p>S\u00e5 snart som m\u00f6jligt ska jag f\u00f6rs\u00f6ka l\u00e4gga upp projektet p\u00e5 GitHub.<br \/>\n<br \/>K\u00e4lla: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/467719\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 &#171;\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433 ASH \u0434\u043b\u044f PostgreSQL &#171;. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u2014 \u043a\u0430\u043a\u0443\u044e \u0436\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f pg_locks. \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435. \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u043d\u043e\u0432\u0438\u0437\u043d\u043e\u0439 \u0442\u0435\u043c\u044b \u0438 \u043d\u0435\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0438\u043e\u0434\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u0442\u0430\u0442\u044c\u044f \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438. \u041a\u0440\u0438\u0442\u0438\u043a\u0430 \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u0432\u0441\u044f\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f \u0438 \u043e\u0436\u0438\u0434\u0430\u044e\u0442\u0441\u044f. \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-38232","post","type-post","status-publish","format-standard","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 &quot;\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433 ASH \u0434\u043b\u044f PostgreSQL &quot;. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u0438.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/sv\/blog\/administrirovanie\/odin-iz-metodov-polucheniya-istorii-blokirovok-v-postgresql\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<meta property=\"og:locale\" content=\"sv_SE\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u041e\u0434\u0438\u043d \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a \u0432 PostgreSQL | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 &quot;\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433 ASH \u0434\u043b\u044f PostgreSQL &quot;. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u0438.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sv\/blog\/administrirovanie\/odin-iz-metodov-polucheniya-istorii-blokirovok-v-postgresql\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T19:22:28+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T19:22:28+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47En av metoderna f\u00f6r att f\u00e5 l\u00e5shistorik i PostgreSQL | ProHoster","description":"Forts\u00e4ttningen av artikeln \"Ett f\u00f6rs\u00f6k att skapa en motsvarighet till ASH f\u00f6r PostgreSQL\". Artikeln kommer att behandla och visa p\u00e5 specifika f\u00f6rfr\u00e5gningar och.","canonical_url":"https:\/\/prohoster.info\/sv\/blog\/administrirovanie\/odin-iz-metodov-polucheniya-istorii-blokirovok-v-postgresql","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"sv_SE","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u041e\u0434\u0438\u043d \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a \u0432 PostgreSQL | ProHoster","og:description":"\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 &quot;\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433 ASH \u0434\u043b\u044f PostgreSQL &quot;. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u0438.","og:url":"https:\/\/prohoster.info\/sv\/blog\/administrirovanie\/odin-iz-metodov-polucheniya-istorii-blokirovok-v-postgresql","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T19:22:28+00:00","article:modified_time":"2019-10-31T19:22:28+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"38232","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-23 21:03:19","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 01:13:22","updated":"2026-01-23 21:03:19","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/posts\/38232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/comments?post=38232"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/posts\/38232\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/media?parent=38232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/categories?post=38232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/tags?post=38232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}