{"id":340752,"date":"2022-11-03T15:01:11","date_gmt":"2022-11-03T15:01:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=340752"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=340752","title":{"rendered":"<span>PostgreSQL 16: \u0427\u0430\u0441\u0442\u044c 2 \u0438\u043b\u0438 \u041a\u043e\u043c\u043c\u0438\u0442\u0444\u0435\u0441\u0442 2022-09<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>PostgreSQL 15 \u0443\u0436\u0435 \u0432\u044b\u0448\u0435\u043b \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e. \u0418 \u0432 \u0441\u0435\u0442\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043d\u043e\u0432\u0438\u043d\u043a\u0430\u0445 \u0432\u0435\u0440\u0441\u0438\u0438. <\/p>\n<p>  <\/p>\n<p>\u0410 \u043c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c \u0441 \u043d\u043e\u0432\u0438\u043d\u043a\u0430\u043c\u0438 \u0431\u0443\u0434\u0443\u0449\u0435\u0439 16-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u043e\u043a\u0442\u044f\u0431\u0440\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0441\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043c\u043c\u0438\u0442\u0444\u0435\u0441\u0442 \u0438 \u0435\u0441\u0442\u044c \u0447\u0442\u043e \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e, \u0438\u044e\u043b\u044c\u0441\u043a\u043e\u0433\u043e, \u043a\u043e\u043c\u043c\u0438\u0442\u0444\u0435\u0441\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0441\u0435\u0440\u0438\u0438: <a href=\"https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/681164\/\">2022-07<\/a>.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"postgresql-15\">PostgreSQL 15<\/h2>\n<p>  <\/p>\n<p>\u041d\u043e \u043d\u0430\u0447\u043d\u0435\u043c \u0441 15-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u0423 \u043d\u0430\u0441 \u043f\u043e\u0442\u0435\u0440\u0438: \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0442\u043a\u0430\u0442\u0438\u043b\u0438 \u0435\u0449\u0435 \u0434\u0432\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438:<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/679264\/#commit_a6baa4ba\">\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 SQL\/JSON<\/a><br \/>  <a href=\"https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/679264\/#commit_db0d67db\">\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f GROUP BY<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"postgresql-16\">PostgreSQL 16<\/h2>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0442 \u043e\u0431\u0437\u043e\u0440 \u043f\u043e\u043f\u0430\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<p><a href=\"#commit_0823d061\">\u0424\u0443\u043d\u043a\u0446\u0438\u044f SYSTEM_USER<\/a><br \/>  <a href=\"#commit_d977ffd9\">\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0437\u0430\u043c\u043e\u0440\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u0432 \u043e\u0442\u0447\u0435\u0442\u0435 \u043e\u0431 \u043e\u0447\u0438\u0441\u0442\u043a\u0435<\/a><br \/>  <a href=\"#commit_d7e39d72\">\u0424\u0443\u043d\u043a\u0446\u0438\u044f pg_stat_get_backend_idset \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u0435\u0430\u043d\u0441\u0430<\/a><br \/>  <a href=\"#commit_1349d279\">\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f ORDER BY \u0438 DISTINCT \u0434\u043b\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/a><br \/>  <a href=\"#commit_3592e0ff\">\u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0432 \u0441\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443<\/a><br \/>  <a href=\"#commit_37a6e5df\">\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0441\u043d\u0438\u043c\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/a><br \/>  <a href=\"#commit_36628396\">\u0414\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f<\/a><br \/>  <a href=\"#commit_ce6b672e\">pg_auth_members: \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u0430 \u0432 \u0440\u043e\u043b\u044f\u0445<\/a><br \/>  <a href=\"#commit_e3ce2de0\">pg_auth_members: \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u043e \u0432 \u0440\u043e\u043b\u044f\u0445 \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439<\/a><br \/>  <a href=\"#commit_8b60db77\">pg_receivewal, pg_recvlogical: \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 SIGTERM<\/a><\/p>\n<p>  <a name=\"commit_0823d061\"><\/a>  <\/p>\n<p><strong><a href=\"https:\/\/commitfest.postgresql.org\/39\/3703\/\">\u0424\u0443\u043d\u043a\u0446\u0438\u044f SYSTEM_USER<\/a><\/strong><br \/>  commit: <a href=\"https:\/\/github.com\/postgres\/postgres\/commit\/0823d061\">0823d061<\/a><\/p>\n<p>  <\/p>\n<p>\u041d\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 SQL, \u043d\u043e \u043d\u0435 \u0431\u044b\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0432 PostgreSQL. \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043c\u0435\u0442\u043e\u0434\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">SELECT session_user, system_user;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"> session_user | system_user   --------------+--------------  alice        | peer:student<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u0435\u0430\u043d\u0441\u0430 alice \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043c\u0435\u0442\u043e\u0434 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 peer, \u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0438\u043c\u0435\u043d\u0438 student (\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u041e\u0421). \u0414\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0431\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 trust \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0435\u0440\u043d\u0435\u0442 NULL.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043f\u043e\u0441\u043b\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <em>log_connections<\/em>.<\/p>\n<p>  <a name=\"commit_d977ffd9\"><\/a>  <\/p>\n<p><strong><a href=\"https:\/\/commitfest.postgresql.org\/39\/3827\/\">\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0437\u0430\u043c\u043e\u0440\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u0432 \u043e\u0442\u0447\u0435\u0442\u0435 \u043e\u0431 \u043e\u0447\u0438\u0441\u0442\u043a\u0435<\/a><\/strong><br \/>  commit: <a href=\"https:\/\/github.com\/postgres\/postgres\/commit\/d977ffd9\">d977ffd9<\/a><\/p>\n<p>  <\/p>\n<p>\u041e\u0442\u0447\u0435\u0442 \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u0432\u044b\u0432\u043e\u0434\u0435 VACUUM (verbose), \u043f\u043e\u043f\u043e\u043b\u043d\u0438\u043b\u0441\u044f \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u043e \u0437\u0430\u043c\u043e\u0440\u043e\u0437\u043a\u0435: \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438 \u0441\u0442\u0440\u043e\u043a \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0431\u044b\u043b\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043e.<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">CREATE TEMP TABLE t AS SELECT 42;  VACUUM (freeze, verbose) t;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">INFO:  aggressively vacuuming \"demo.pg_temp_3.t\" INFO:  finished vacuuming \"demo.pg_temp_3.t\": index scans: 0 pages: 0 removed, 1 remain, 1 scanned (100.00% of total) tuples: 0 removed, 1 remain, 0 are dead but not yet removable removable cutoff: 945, which was 0 XIDs old when operation ended new relfrozenxid: 945, which is 1 XIDs ahead of previous value frozen: 1 pages from table (100.00% of total) had 1 tuples frozen index scan not needed: 0 pages from table (0.00% of total) had 0 dead item identifiers removed avg read rate: 91.912 MB\/s, avg write rate: 0.000 MB\/s buffer usage: 5 hits, 4 misses, 0 dirtied WAL usage: 1 records, 0 full page images, 188 bytes system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s VACUUM<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u00abfrozen:\u00bb.<\/p>\n<p>  <a name=\"commit_d7e39d72\"><\/a>  <\/p>\n<p><strong><a href=\"https:\/\/commitfest.postgresql.org\/39\/3816\/\">\u0424\u0443\u043d\u043a\u0446\u0438\u044f pg_stat_get_backend_idset \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u0435\u0430\u043d\u0441\u0430<\/a><\/strong><br \/>  commit: <a href=\"https:\/\/github.com\/postgres\/postgres\/commit\/d7e39d72\">d7e39d72<\/a><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0447\u0442\u043e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0430\u043d\u0441\u043e\u0432, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438, \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0445\u0435\u043c\u0430\u0445. \u0421\u043f\u0438\u0441\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0445\u0435\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">SELECT n.nspname,        regexp_replace(n.nspname, '^pg_temp_', '')::int AS backend_id FROM   pg_namespace n                                                     WHERE  n.nspname ~ '^pg_temp_';<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  nspname  | backend_id -----------+------------  pg_temp_5 |        5  pg_temp_3 |        3  pg_temp_4 |        4 (3 rows)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a \u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u043d\u0443\u0436\u0435\u043d \u0440\u044f\u0434 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0439. \u0421\u0442\u043e\u043b\u0431\u0435\u0446 backend_id \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0441\u0435\u0430\u043d\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u044b. \u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e, \u0438 \u043d\u043e\u0432\u043e\u043c\u0443 \u0441\u0435\u0430\u043d\u0441\u0443 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d \u043d\u043e\u043c\u0435\u0440 \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f. \u041f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u0441\u0435\u0430\u043d\u0441\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0445\u0435\u043c\u044b \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f. \u041e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b \u0434\u043b\u044f \u043d\u043e\u0432\u044b\u0445 \u0441\u0435\u0430\u043d\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043a\u0430\u043a \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0445\u0435\u043c\u044b \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435? \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0448\u0435\u0433\u043e \u0441\u0435\u0430\u043d\u0441\u0430, \u0432 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u044b \u043c\u0435\u0448\u0430\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u0430\u043c\u043e\u0440\u043e\u0437\u043a\u0443, \u0447\u0442\u043e \u0443\u0433\u0440\u043e\u0436\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0431\u044b\u043b\u0430 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f pg_stat_get_backend_idset \u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0435\u0439 <a href=\"https:\/\/www.postgresql.org\/docs\/devel\/monitoring-stats.html#MONITORING-STATS-BACKEND-FUNCS-TABLE\">\u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/a>. \u0420\u0430\u043d\u044c\u0448\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b\u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u0441\u0435\u0430\u043d\u0441\u043e\u0432 \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0441\u0435\u0430\u043d\u0441\u043e\u0432. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f\/\u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u0435\u0430\u043d\u0441\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0435\u0430\u043d\u0441\u0430 \u043c\u043e\u0433\u043b\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f. \u0422\u0435\u043f\u0435\u0440\u044c pg_stat_get_backend_idset \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0441\u0435\u0430\u043d\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 backend_id \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. <\/p>\n<p>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0445\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">WITH tmp AS (     SELECT n.nspname,                                                        regexp_replace(n.nspname, '^pg_temp_', '')::int AS backend_id     FROM   pg_namespace n     WHERE  n.nspname ~ '^pg_temp_' ) SELECT pg_stat_get_backend_pid(backend_id) AS pid,        nspname FROM   tmp        LEFT JOIN pg_stat_get_backend_idset() AS b(backend_id)            USING (backend_id);<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  pid   |  nspname   --------+-----------  336661 | pg_temp_3  349872 | pg_temp_4         | pg_temp_5 (3 rows)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043e\u0434\u043d\u043e \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u0445\u0435\u043c\u0430 pg_temp_5 \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>  <a name=\"commit_1349d279\"><\/a>  <\/p>\n<p><strong><a href=\"https:\/\/commitfest.postgresql.org\/39\/3164\/\">\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f ORDER BY \u0438 DISTINCT \u0434\u043b\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/a><\/strong><br \/>  commit: <a href=\"https:\/\/github.com\/postgres\/postgres\/commit\/1349d279\">1349d279<\/a><\/p>\n<p>  <\/p>\n<p>\u0410\u0433\u0440\u0435\u0433\u0430\u0442\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0438\u043b\u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442\u043e\u0432, \u0441\u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">SELECT flight_no,        array_agg(status ORDER BY status),        array_agg(DISTINCT status) FROM flights GROUP BY flight_no;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u043e\u0431\u043e\u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 array_agg \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430 \u0440\u0435\u0439\u0441\u0430. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">CREATE INDEX ON flights (flight_no, status);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0432 16-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u0432 \u0440\u0435\u0439\u0441\u0430 \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u043d\u0435 \u0434\u043e\u0436\u0438\u0434\u0430\u044f\u0441\u044c \u043f\u043e\u043a\u0430 \u043e\u043d\u0438 \u0432\u0441\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b \u0438 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043c\u043e\u0435\u043c \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0435 \u0432 16-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 \u043f\u043e\u043b\u0442\u043e\u0440\u0430 \u0440\u0430\u0437\u0430 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u0432 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0438 \u0441 \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043f\u043b\u0430\u043d\u043e\u043c \u0432 15-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<p>  <a name=\"commit_3592e0ff\"><\/a>  <\/p>\n<p><strong><a href=\"https:\/\/commitfest.postgresql.org\/39\/3270\/\">\u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u043e\u0432\u043e\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0432 \u0441\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443<\/a><\/strong><br \/>  commit: <a href=\"https:\/\/github.com\/postgres\/postgres\/commit\/3592e0ff\">3592e0ff<\/a><\/p>\n<p>  <\/p>\n<p>\u041f\u0430\u0442\u0447 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u043c\u0430\u0441\u0441\u043e\u0432\u0443\u044e \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0438\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0430\u0441\u0441\u043e\u0432\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0441\u0435\u043a\u0446\u0438\u044e \u0431\u0443\u0434\u0443\u0442 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043f\u043e\u0438\u0441\u043a \u0441\u0435\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438. \u0415\u0441\u043b\u0438 16 (\u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430 \u0432 \u043a\u043e\u0434\u0435) \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u043e\u0434\u0440\u044f\u0434 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0441\u0435\u043a\u0446\u0438\u044e, \u0442\u043e \u0438\u043c\u044f \u0441\u0435\u043a\u0446\u0438\u0438 \u043a\u0435\u0448\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u0441\u0435\u043a\u0446\u0438\u044e. <\/p>\n<p>  <\/p>\n<p>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446, \u0441\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0443 \u0438\u043b\u0438 \u0441\u043f\u0438\u0441\u043a\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0414\u043b\u044f \u0441\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0445\u0435\u0448\u0443 \u043e\u043d\u0430 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430. <\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u0441\u0442\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 ~15-20% \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  <a name=\"commit_37a6e5df\"><\/a>  <\/p>\n<p><strong><a href=\"https:\/\/commitfest.postgresql.org\/39\/3768\/\">\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0441\u043d\u0438\u043c\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/a><\/strong><br \/>  commit: <a href=\"https:\/\/github.com\/postgres\/postgres\/commit\/37a6e5df\">37a6e5df<\/a>, <a href=\"https:\/\/github.com\/postgres\/postgres\/commit\/b6ef1675\">b6ef1675<\/a>, <a href=\"https:\/\/github.com\/postgres\/postgres\/commit\/82739d4a\">82739d4a<\/a><\/p>\n<p>  <\/p>\n<p>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443 (\u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043c\u043c\u0438\u0442) \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c x86-64 (\u0432\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043c\u043c\u0438\u0442) \u0438 arm (\u0442\u0440\u0435\u0442\u0438\u0439 \u043a\u043e\u043c\u043c\u0438\u0442). \u041d\u043e\u0432\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 SIMD, \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b\u0438 \u043a \u043f\u043e\u0438\u0441\u043a\u0443 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439 \u0441\u043d\u0438\u043c\u043a\u0430 (snapshot->xip array). \u041f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c (\u0441\u043e\u0442\u043d\u0438) \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0438\u0448\u0443\u0449\u0438\u0445 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439 \u044d\u0442\u043e \u0434\u0430\u0435\u0442 \u043e\u0449\u0443\u0442\u0438\u043c\u044b\u0439 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u0430\u0432\u0438\u043b \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u043a, \u0430 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0432 \u043e\u0431\u0449\u0435\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  <a name=\"commit_36628396\"><\/a>  <\/p>\n<p><strong><a href=\"https:\/\/commitfest.postgresql.org\/39\/3610\/\">\u0414\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f<\/a><\/strong><br \/>  commit: <a href=\"https:\/\/github.com\/postgres\/postgres\/commit\/36628396\">36628396<\/a><\/p>\n<p>  <\/p>\n<p>\u0414\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432\u0442\u043e\u0440\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0436\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0435\u0440\u0432\u044b\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0438\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u0431\u0443\u0434\u0443\u0442 \u0432\u0438\u0434\u043d\u044b \u043d\u0430 \u043e\u0431\u043e\u0438\u0445.<\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 PostgreSQL \u043d\u0435\u043b\u044c\u0437\u044f. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440-\u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043b\u044e\u0431\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430: \u043a\u0430\u043a \u043a\u043e\u043c\u0430\u043d\u0434\u044b SQL, \u0442\u0430\u043a \u0438 \u0440\u0435\u043f\u043b\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u041a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 SQL, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u0418 \u044d\u0442\u0438 \u0436\u0435 \u0441\u0430\u043c\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u043e\u0431\u0440\u0430\u0437\u0443\u044f \u0437\u0430\u043c\u043a\u043d\u0443\u0442\u044b\u0439 \u043a\u0440\u0443\u0433 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u0442\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 CREATE SUBSCRIPTION \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u0435\u043d \u0441\u043f\u043e\u0441\u043e\u0431, \u043f\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 SQL, \u043d\u043e \u043d\u0435 \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u0435 \u043f\u043e \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438. \u0418 \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f. <\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f PostgreSQL \u0443\u043c\u0435\u0435\u0442, \u0432\u0435\u0434\u044c \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 WAL \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438 (origin). \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0441 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438. <\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0434\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0430 \u0434\u0432\u0443\u0445 \u0443\u0437\u043b\u0430\u0445 (node_1 \u0438 node_2), \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u0440\u0442\u0430\u0445 5401 \u0438 5402 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>wal_level<\/em> \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u0430\u0445:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_1=# SHOW wal_level;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">wal_level  -----------  logical (1 row)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e. \u0421\u0442\u043e\u043b\u0431\u0435\u0446 node \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u043c, \u043d\u043e \u043e\u043d \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_1=# CREATE TABLE test (              node text DEFAULT 'node_1',              id int,              PRIMARY KEY (node, id)          ); node_1=# CREATE PUBLICATION pub1 FOR TABLE test;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u0443\u0437\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_2=# CREATE TABLE test (              node text DEFAULT 'node_2',              id int,              PRIMARY KEY (node, id)          ); node_2=# CREATE PUBLICATION pub2 FOR TABLE test;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u2014 \u043d\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u043f\u0435\u0440\u0432\u043e\u0433\u043e.<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_1=# CREATE SUBSCRIPTION sub1_pub2              CONNECTION 'port=5402 user=postgres dbname=postgres'              PUBLICATION pub2              WITH (copy_data = false, origin = none); node_2=# CREATE SUBSCRIPTION sub2_pub1              CONNECTION 'port=5401 user=postgres dbname=postgres'              PUBLICATION pub1              WITH (copy_data = false, origin = none);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0430\u0436\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435:<\/p>\n<p>  <\/p>\n<ul>\n<li>origin = none \u2015 \u043d\u043e\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438, \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0446\u0438\u043a\u043b\u043e\u0432 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e\u0449\u0435\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043d\u0435 \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 SQL. \u0412\u0442\u043e\u0440\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u2015 any \u2015 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445.<\/li>\n<li>copy_data = false \u2015 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u041b\u0438\u0431\u043e, \u043a\u0430\u043a \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c\u0438.<\/li>\n<li>\u0422\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f, \u043f\u043e\u043a\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u0430.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0435 \u0432 \u043a\u0430\u0436\u0434\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_1=# INSERT INTO test (id) VALUES (1); node_2=# INSERT INTO test (id) VALUES (1);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_1=# SELECT * FROM test ORDER BY 1,2;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"> node   | id  --------+----  node_1 |  1  node_2 |  1 (2 rows)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_2=# SELECT * FROM test ORDER BY 1,2;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"> node   | id  --------+----  node_1 |  1  node_2 |  1 (2 rows)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0432\u0443\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0442\u0440\u0435\u0442\u0438\u0439 \u0443\u0437\u0435\u043b, \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043f\u043e\u0440\u0442\u0443 5403. \u041d\u0430 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u043e\u0432 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_3=# CREATE TABLE test (              node text DEFAULT 'node_3',              id int,              PRIMARY KEY (node, id)          ); node_3=# CREATE PUBLICATION pub3 FOR TABLE test;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u0443\u0437\u043b\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e.<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_1=# CREATE SUBSCRIPTION sub1_pub3              CONNECTION 'port=5403 user=postgres dbname=postgres'              PUBLICATION pub3              WITH (copy_data = false, origin = none); node_2=# CREATE SUBSCRIPTION sub2_pub3              CONNECTION 'port=5403 user=postgres dbname=postgres'              PUBLICATION pub3              WITH (copy_data = false, origin = none);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0440\u0435\u0442\u0438\u0439 \u0443\u0437\u0435\u043b \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0435 \u0434\u0432\u0430 \u0443\u0437\u043b\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_3=# CREATE SUBSCRIPTION sub3_pub1              CONNECTION 'port=5401 user=postgres dbname=postgres'              PUBLICATION pub1              WITH (copy_data = true, origin = none);<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">WARNING:  subscription \"sub3_pub1\" requested copy_data with origin = NONE but might copy data that had a different origin DETAIL:  Subscribed publication \"pub1\" is subscribing to other publications. HINT:  Verify that initial data copied from the publisher tables did not come from other origins. NOTICE:  created replication slot \"sub3_pub1\" on publisher CREATE SUBSCRIPTION<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438: copy_data = true, origin = none. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 CREATE SUBSCRIPTION \u0432\u044b\u0434\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438. \u041d\u043e \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0443\u0437\u043b\u0430 \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0430 \u043d\u0435\u0433\u043e \u043e\u0431\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0435 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0443\u0437\u0435\u043b \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0443\u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_3=# CREATE SUBSCRIPTION sub3_pub2              CONNECTION 'port=5402 user=postgres dbname=postgres'              PUBLICATION pub2              WITH (copy_data = false, origin = none);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0442\u0440\u0435\u0442\u044c\u0435\u043c \u0443\u0437\u043b\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_3=# INSERT INTO test (id) VALUES (1);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u0430\u0445.<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_1=# SELECT * FROM test ORDER BY 1,2;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"> node   | id  --------+----  node_1 |  1  node_2 |  1  node_3 |  1 (3 rows)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_2=# SELECT * FROM test ORDER BY 1,2;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  node   | id  --------+----  node_1 |  1  node_2 |  1  node_3 |  1 (3 rows)<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"pgsql\">node_3=# SELECT * FROM test ORDER BY 1,2;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  node   | id  --------+----  node_1 |  1  node_2 |  1  node_3 |  1 (3 rows)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043c\u0443\u043b\u044c\u0442\u0438\u043c\u0430\u0441\u0442\u0435\u0440!<\/p>\n<p>  <a name=\"commit_ce6b672e\"><\/a>  <\/p>\n<p><strong><a href=\"https:\/\/commitfest.postgresql.org\/39\/3745\/\">pg_auth_members: \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u0430 \u0432 \u0440\u043e\u043b\u044f\u0445<\/a><\/strong><br \/>  commit: <a href=\"https:\/\/github.com\/postgres\/postgres\/commit\/ce6b672e\">ce6b672e<\/a>, <a href=\"https:\/\/github.com\/postgres\/postgres\/commit\/6566133c\">6566133c<\/a><\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0440\u043e\u043b\u0438 \u0441 \u043f\u0440\u0430\u0432\u043e\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">CREATE ROLE alice LOGIN; CREATE ROLE bob LOGIN; CREATE ROLE charlie LOGIN;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u00ab\u0441\u0442\u0430\u0440\u043e\u0439\u00bb 15-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432 16-\u0439.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043c alice \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u043e \u0432 \u0440\u043e\u043b\u0438 bob. \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f GRANTED BY \u043a\u043e\u043c\u0430\u043d\u0434\u044b GRANT \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u043e\u043b\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0430 \u044d\u0442\u043e \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u043e, \u0438 \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">15=# GRANT bob TO alice GRANTED BY charlie;  15=# SELECT roleid::regrole,             member::regrole,             grantor::regrole,             * FROM pg_auth_members WHERE roleid::regrole::text !~ '^pg_';<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"> roleid | member | grantor | roleid | member | grantor | admin_option --------+--------+---------+--------+--------+---------+--------------  bob    | alice  | charlie |  24590 |  24589 |   24591 | f<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e \u043d\u0435 \u0437\u043d\u0430\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u0432 pg_auth_members, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c: \u043f\u043e\u0447\u0435\u043c\u0443 charlie \u0441\u043c\u043e\u0433 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c alice \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u043e \u0432 \u0440\u043e\u043b\u0438 bob? \u0412\u0435\u0434\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e charlie \u0441\u0430\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0447\u043b\u0435\u043d\u043e\u043c \u0440\u043e\u043b\u0438 bob, \u043f\u0440\u0438\u0447\u0435\u043c \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u043e\u043b\u0435\u0439 (WITH ADMIN OPTION). \u0410 charlie \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0432 \u0440\u043e\u043b\u044c bob.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 GRANT \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (postgres), \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c. \u041d\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e charlie \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b alice \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u043e \u0432 \u0440\u043e\u043b\u0438 bob, \u043d\u0435 \u0438\u043c\u0435\u044f \u043d\u0430 \u044d\u0442\u043e \u043f\u0440\u0430\u0432. \u0427\u0442\u043e \u043d\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0418\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435. \u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u0443\u0434\u0430\u043b\u0438\u043c \u0440\u043e\u043b\u044c charlie?<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">15=# DROP ROLE charlie;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">DROP ROLE<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u043e\u043b\u044c \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f. \u041d\u043e \u0447\u0442\u043e \u0441 \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u043e\u043c alice \u0432 bob, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b charlie?<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">15=# SELECT roleid::regrole,             member::regrole,             grantor::regrole,             * FROM pg_auth_members WHERE roleid::regrole::text !~ '^pg_';<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"> roleid | member | grantor | roleid | member | grantor | admin_option --------+--------+---------+--------+--------+---------+--------------  bob    | alice  | 24591   |  24590 |  24589 |   24591 | f<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u043c\u0435\u0441\u0442\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u043e, \u043d\u043e \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e grantor! 24591 \u044d\u0442\u043e OID \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u0440\u043e\u043b\u0438 charlie. \u041f\u043e \u0441\u0443\u0442\u0438, \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 pg_auth_members \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u043c\u0443\u0441\u043e\u0440. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u043d\u043e\u043c\u0435\u0440 OID \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043d\u043e\u0432\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u043e\u043b\u0438! \u0418 \u0442\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0447\u0442\u043e \u043a\u0442\u043e-\u0442\u043e \u0435\u0449\u0435, \u0430 \u0432\u043e\u0432\u0441\u0435 \u043d\u0435 charlie, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u043b alice \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u043e \u0432 bob. \u0422\u0430\u043a\u043e\u0435 \u043c\u0430\u043b\u043e\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0432 16-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0440\u0435\u0445 \u0440\u043e\u043b\u0435\u0439 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c alice \u0432 bob \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 charlie:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16=# GRANT bob TO alice GRANTED BY charlie;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">ERROR:  grantor must have ADMIN OPTION on \"bob\"<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043e\u0448\u0438\u0431\u043a\u0443 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0440\u043e\u043b\u044c charlie \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432 \u0440\u043e\u043b\u044c bob \u0441 \u043f\u0440\u0430\u0432\u043e\u043c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u043e\u043b\u0435\u0439.<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16=# GRANT bob TO charlie WITH ADMIN OPTION;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">GRANT ROLE<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16=# GRANT bob TO alice GRANTED BY charlie;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">GRANT ROLE<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, alice \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432 \u0440\u043e\u043b\u044c bob.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0440\u043e\u043b\u044c charlie:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16=# DROP ROLE charlie;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">ERROR:  role \"charlie\" cannot be dropped because some objects depend on it DETAIL:  privileges for membership of role alice in role bob<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u043b\u0438 \u043e\u0442\u043e\u0437\u0432\u0430\u0442\u044c ADMIN OPTION:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16=# REVOKE ADMIN OPTION FOR bob FROM charlie ;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">ERROR:  dependent privileges exist HINT:  Use CASCADE to revoke them too.<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0442\u043e\u0437\u0432\u0430\u0442\u044c ADMIN OPTION \u043c\u043e\u0436\u043d\u043e, \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u0430\u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e CASCADE, \u0430 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0440\u043e\u043b\u044c \u043d\u0435\u043b\u044c\u0437\u044f. \u0420\u043e\u043b\u044c charlie \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0444\u0430\u043a\u0442\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u0430 \u0432 \u0440\u043e\u043b\u0438. \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 pg_auth_members \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0441\u0442\u043e\u043b\u0431\u0435\u0446 OID, \u0430 \u0441\u0430\u043c\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 pg_shdepend. \u041c\u043e\u0436\u0435\u043c \u043d\u0430\u0439\u0442\u0438 \u0435\u0451:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16=# SELECT oid,             roleid::regrole,             member::regrole,             grantor::regrole FROM pg_auth_members WHERE oid = 16572;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  oid  | roleid | member | grantor -------+--------+--------+---------  16572 | bob    | alice  | charlie<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16=# SELECT d.classid::regclass,             (SELECT m FROM pg_auth_members m WHERE m.oid = d.objid) AS objid,             d.refclassid::regclass,             d.refobjid::regrole FROM pg_shdepend d\\gx<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">-[ RECORD 1 ]----------------------------- classid    | pg_auth_members objid      | (16572,16569,16568,16570,f,t) refclassid | pg_authid refobjid   | charlie<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u0430 \u0432 \u0440\u043e\u043b\u044f\u0445 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0440\u043e\u043b\u0438 \u043d\u0435 \u0441\u0430\u043c\u0430\u044f \u0432\u043e\u0441\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0432 16-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c.<\/p>\n<p>  <a name=\"commit_e3ce2de0\"><\/a>  <\/p>\n<p><strong><a href=\"https:\/\/commitfest.postgresql.org\/39\/3744\/\">pg_auth_members: \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u043e \u0432 \u0440\u043e\u043b\u044f\u0445 \u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439<\/a><\/strong><br \/>  commit: <a href=\"https:\/\/github.com\/postgres\/postgres\/commit\/e3ce2de0\">e3ce2de0<\/a>, <a href=\"https:\/\/github.com\/postgres\/postgres\/commit\/48a257d4\">48a257d4<\/a><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u0430\u0442\u0447 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d \u0440\u043e\u043b\u0438, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0439 \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u043e \u0432 \u0440\u043e\u043b\u044f\u0445. \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0447\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e \u0440\u043e\u043b\u0438, \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0439 \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u043e \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u043e\u043b\u0438. <\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0441 15-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">15-postgres=# CREATE ROLE alice LOGIN; 15-postgres=# CREATE ROLE bob LOGIN;  15-postgres=# GRANT bob TO alice;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u044b \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c alice \u0432 bob \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0440\u043e\u043b\u044c alice \u043c\u043e\u0433\u043b\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u044f\u043c\u0438 \u0440\u043e\u043b\u0438 bob.<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">15-postgres=# CREATE TABLE t AS SELECT 42 AS col; 15-postgres=# GRANT SELECT ON t TO bob;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e bob, \u043d\u043e \u0438 alice \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">15-alice=> SELECT * FROM t;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"> col -----   42 (1 row)<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442. \u043a. \u0443 \u0440\u043e\u043b\u0438 alice \u0435\u0441\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 INHERIT (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0435\u0441\u0442\u044c \u0443 \u0432\u0441\u0435\u0445 \u0440\u043e\u043b\u0435\u0439), \u0438 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0438 \u0440\u043e\u043b\u0438 bob \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f alice.<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">15-alice=> SELECT rolname, rolinherit FROM pg_roles WHERE rolname = 'alice';<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"> rolname | rolinherit ---------+------------  alice   | t<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u0442\u043e alice \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u044f\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0440\u043e\u043b\u044c bob \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">15-postgres=# ALTER ROLE alice NOINHERIT;  15-alice=> SELECT * FROM t;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">ERROR:  permission denied for table t<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"pgsql\">15-alice=> SET ROLE bob; 15-alice=> SELECT * FROM t;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"> col -----   42 (1 row)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u043e\u043b\u0438 alice \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0435\u0451 \u0432 \u043f\u0440\u0435\u0434\u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u0440\u043e\u043b\u044c pg_read_all_settings \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0432\u0441\u0435\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">15-postgres=# GRANT pg_read_all_settings TO alice;  15-alice=> SHOW data_directory;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">ERROR:  must be superuser or have privileges of pg_read_all_settings to examine \"data_directory\"<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 INHERIT \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u044f\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0440\u043e\u043b\u044c \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u044f\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">15-alice=> SET ROLE pg_read_all_settings; 15-alice=> SHOW data_directory;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">   data_directory     ---------------------  \/home\/pal\/pg15\/data<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u043e\u043b\u044c pg_read_all_settings \u044f\u0432\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0431\u043e\u0440! \u0425\u043e\u0447\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0438 pg_read_all_settings \u0431\u044b\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439 \u0440\u043e\u043b\u0438 bob \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u044f\u0432\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>  <\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0430\u0442\u0447. \u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0432 16-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16-postgres=# CREATE ROLE alice LOGIN; 16-postgres=# CREATE ROLE bob LOGIN;  16-postgres=# CREATE TABLE t AS SELECT 42 AS col; 16-postgres=# GRANT SELECT ON t TO bob;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u044b GRANT \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043b\u0438. \u041f\u0440\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0439 \u0440\u043e\u043b\u0438 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0434\u043e\u043b\u0436\u043d\u044b \u043b\u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16-postgres=# GRANT bob TO alice WITH INHERIT FALSE; 16-postgres=# GRANT pg_read_all_settings TO alice WITH INHERIT TRUE;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c alice \u043c\u043e\u0436\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u044f\u043c\u0438 pg_read_all_settings, \u0430 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 get_ultimate_answer \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432 \u0440\u043e\u043b\u044c bob:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16-alice=> SHOW data_directory;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">   data_directory     ---------------------  \/home\/pal\/pg16\/data<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16-alice=> SELECT * FROM t;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">ERROR:  permission denied for table t<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16-alice=> SET ROLE bob; 16-alice=> SELECT * FROM t;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"> col -----   42 (1 row)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0424\u0430\u043a\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u0430 \u0432 \u0440\u043e\u043b\u044f\u0445 (GRANT) \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 pg_auth_members. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u0438\u0437\u043d\u0430\u043a \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439 (inherit_option):<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16-postgres=# SELECT roleid::regrole, member::regrole, grantor::regrole,                      admin_option, inherit_option FROM pg_auth_members WHERE member = 'alice'::regrole;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">        roleid        | member | grantor  | admin_option | inherit_option ----------------------+--------+----------+--------------+----------------  bob                  | alice  | postgres | f            | f  pg_read_all_settings | alice  | postgres | f            | t<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0447\u0442\u043e \u0436\u0435 \u0441\u0442\u0430\u043b\u043e \u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c \u0440\u043e\u043b\u0438 INHERIT? \u041e\u043d \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 GRANT, \u0435\u0441\u043b\u0438 \u0432 \u043d\u0435\u0439 \u044f\u0432\u043d\u043e \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e WITH INHERIT. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443 alice \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0430\u0442\u0440\u0438\u0431\u0443\u0442 INHERIT, \u0437\u043d\u0430\u0447\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0435\u0433\u043e \u0432 pg_auth_members:<\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16-postgres=# GRANT pg_read_all_data TO alice;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043e\u0442\u043e\u0437\u0432\u0430\u0442\u044c. <\/p>\n<p>  <\/p>\n<pre><code class=\"pgsql\">16-postgres=# ALTER ROLE alice NOINHERIT; 16-postgres=# GRANT pg_write_all_data TO alice;  16-postgres=# SELECT roleid::regrole, member::regrole, grantor::regrole,                      admin_option, inherit_option FROM pg_auth_members WHERE member = 'alice'::regrole;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\">        roleid        | member | grantor  | admin_option | inherit_option ----------------------+--------+----------+--------------+----------------  bob                  | alice  | postgres | f            | f  pg_read_all_settings | alice  | postgres | f            | t  pg_read_all_data     | alice  | postgres | f            | t  pg_write_all_data    | alice  | postgres | f            | f<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0430\u0436\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434. \u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u0447\u0430\u0441\u0442\u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439 \u0432 16-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f. \u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u0440\u043e\u043b\u0438 INHERIT \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439, \u0430 \u0432\u043b\u0438\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b GRANT \u0431\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f WITH INHERIT.<\/p>\n<p>  <\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043c\u043c\u0438\u0442 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b ALTER DEFAULT PRIVILEGES. \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u044f\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u043e\u043b\u0435\u0439 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 INHERIT. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 alice \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c ALTER DEFAULT PRIVILEGES \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u044f\u043c\u0438 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u0441\u0445\u0435\u043c\u0435 bob.<\/p>\n<p>  <a name=\"commit_8b60db77\"><\/a>  <\/p>\n<p><strong><a href=\"https:\/\/commitfest.postgresql.org\/39\/3825\/\">pg_receivewal, pg_recvlogical: \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 SIGTERM<\/a><\/strong><br \/>  commit: <a href=\"https:\/\/github.com\/postgres\/postgres\/commit\/8b60db77\">8b60db77<\/a><\/p>\n<p>  <\/p>\n<p>pg_receivewal \u0438 pg_recvlogical \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u043a \u0434\u0435\u043c\u043e\u043d\u043e\u0432. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u044f \u0438\u0445 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 systemd \u0443\u043c\u0435\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0438\u0433\u043d\u0430\u043b SIGTERM, \u043d\u043e \u043e\u0431\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e SIGINT. \u0410 \u043f\u043e SIGTERM \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443. \u0418 \u0432\u0441\u0451 \u0431\u044b \u043d\u0438\u0447\u0435\u0433\u043e, \u043d\u043e pg_receivewal \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c \u0441\u0436\u0430\u0442\u0438\u0435\u043c \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b \u043d\u0430 \u0434\u0438\u0441\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0434\u043b\u044f \u043e\u0431\u0435\u0438\u0445 \u0443\u0442\u0438\u043b\u0438\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 SIGTERM.<\/p>\n<p>  <\/p>\n<hr\/>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u043a\u0430 \u0432\u0441\u0451. \u0416\u0434\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e <a href=\"https:\/\/commitfest.postgresql.org\/40\/\">\u043d\u043e\u044f\u0431\u0440\u044c\u044f\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0444\u0435\u0441\u0442\u0430<\/a>.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/697228\/\"> https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/697228\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>PostgreSQL 15 \u0443\u0436\u0435 \u0432\u044b\u0448\u0435\u043b \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e. \u0418 \u0432 \u0441\u0435\u0442\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043d\u043e\u0432\u0438\u043d\u043a\u0430\u0445 \u0432\u0435\u0440\u0441\u0438\u0438. <\/p>\n<p>  <\/p>\n<p>\u0410 \u043c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c \u0441 \u043d\u043e\u0432\u0438\u043d\u043a\u0430\u043c\u0438 \u0431\u0443\u0434\u0443\u0449\u0435\u0439 16-\u0439 \u0432\u0435\u0440\u0441\u0438\u0438. \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u043e\u043a\u0442\u044f\u0431\u0440\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0441\u044f \u0432\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043c\u043c\u0438\u0442\u0444\u0435\u0441\u0442 \u0438 \u0435\u0441\u0442\u044c \u0447\u0442\u043e \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e, \u0438\u044e\u043b\u044c\u0441\u043a\u043e\u0433\u043e, \u043a\u043e\u043c\u043c\u0438\u0442\u0444\u0435\u0441\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0441\u0435\u0440\u0438\u0438: <a href=\"https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/681164\/\">2022-07<\/a>.<\/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-340752","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340752","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=340752"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340752\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=340752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=340752"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=340752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}