{"id":337618,"date":"2022-08-27T21:00:17","date_gmt":"2022-08-27T21:00:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=337618"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=337618","title":{"rendered":"<span>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 Oracle \u043d\u0430 PostgreSQL: \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0445 \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u043d\u0438\u044f<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438\u00a0\u0441 Oracle \u043d\u0430 Postgres \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e (<a href=\"https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/676792\/\">\u0447\u0430\u0441\u0442\u044c 1<\/a>, <a href=\"https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/679808\/\">\u0447\u0430\u0441\u0442\u044c 2<\/a>).  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043f\u043e\u0439\u0434\u0451\u0442 \u043e\u0431 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u043c \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043c\u0435\u043d\u044b \u0421\u0423\u0411\u0414. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b:<\/p>\n<ol>\n<li>\n<p>\u041a\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043d\u0430 PostgreSQL.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0437\u0430\u043c\u0435\u043d\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0421\u0423\u0411\u0414 \u043f\u0440\u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 \u0421\u0423\u0411\u0414-\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 <a href=\"https:\/\/docs.oracle.com\/en\/database\/oracle\/oracle-database\/21\/lnpls\/index.html\"><strong><u>PL\/SQL<\/u><\/strong><\/a><strong> \u043d\u0430 <\/strong><a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/plpgsql\"><strong><u>PL\/pgSQL<\/u><\/strong><\/a>. \u041a\u043e\u0434 \u043d\u0430 PL\/SQL\u00a0<a href=\"https:\/\/www.orafaq.com\/node\/2899\"><u>\u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434 \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c<\/u><\/a><u>, <\/u>\u0430 \u043a\u043e\u0434 \u043d\u0430 PL\/pgSQL \u043d\u0435\u043b\u044c\u0437\u044f. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b PL\/SQL \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0431\u0449\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u044f\u0434\u0440\u043e\u043c \u041e\u0421, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. <\/p>\n<p>\u0421\u0442\u0435\u043f\u0435\u043d\u044c \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e PL\/SQL. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0431\u0430\u0437\u044b, \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0438\u0445 (\u0446\u0438\u043a\u043b\u044b, \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438).<\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 PL\/SQL \u044f\u0437\u044b\u043a\u0430 PL\/pgSQL \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 prosrc \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/catalog-pg-proc\"><u>pg_proc<\/u><\/a>. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043a\u043e\u0439, \u043a\u0430\u043a\u043e\u0439 \u043e\u043d \u0431\u044b\u043b \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/sql-createfunction\">CREATE FUNCTION<\/a> \u0438\/\u0438\u043b\u0438 <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/sql-createprocedure\">CREATE PROCEDURE<\/a>. \u041a\u043e\u0433\u0434\u0430 \u0441\u0435\u0441\u0441\u0438\u044f \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0442\u043e:<\/p>\n<ol>\n<li>\n<p>\u0415\u0451 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u043e \u0440\u0430\u0437\u0431\u043e\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043e\u0439\u0442\u0438 \u0435\u0433\u043e \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443. <\/p>\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0435\u0441\u044c \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043a\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0421\u0423\u0411\u0414-\u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430. \u0415\u0441\u043b\u0438 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043a\u043e\u0434 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f,\u00a0\u0442\u043e \u043c\u043e\u0436\u043d\u043e:<\/p>\n<ol>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.  <\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u00ab\u0443\u043c\u043d\u044b\u0439\u00bb \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0442\u043e\u0442 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0411\u0414.<\/p>\n<\/li>\n<\/ol>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438, \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0430 \u043d\u0435 \u043d\u0430 PL\/pgSQL. <\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u0430\u044f: \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u0421\u0423\u0411\u0414 \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u0442\u0430\u0440\u0430\u044e\u0442\u0441\u044f \u0432\u0437\u044f\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0431\u044b\u043b \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0435\u043d \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0421\u0423\u0411\u0414, \u0438 <strong>\u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u043e\u0432\u043e\u0439 \u0421\u0423\u0411\u0414 \u0442\u0430\u043a, \u043a\u0430\u043a \u0443\u0436\u0435 \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u0441 \u043f\u0440\u0435\u0436\u043d\u0435\u0439<\/strong>. \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0439 \u0421\u0423\u0411\u0414. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c.<\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442<strong> \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0431\u0435\u0437\u0434\u0443\u043c\u043d\u043e \u0438\u0437 Oracle \u0432 Postgres, \u0430 \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u043e\u0432\u043e\u0439 \u0421\u0423\u0411\u0414 (\u00ab\u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430\u00bb)<\/strong>. \u0423 \u043b\u044e\u0431\u043e\u0439 \u0421\u0423\u0411\u0414 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0441 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e Postgres \u0440\u0435\u0448\u0430\u0435\u0442 \u0441\u0432\u043e\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0435 \u0445\u0443\u0436\u0435 Oracle, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u0430\u0436\u0435 \u043b\u0443\u0447\u0448\u0435 &#8212; \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0435\u043e\u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u0435\u043d \u043a\u043e\u0434 PL\/SQL \u2013 \u0440\u0430\u0441\u0447\u0451\u0442\u044b \u0431\u0438\u043b\u043b\u0438\u043d\u0433\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043d\u043e\u0433\u043e.<\/p>\n<p>\u0412\u044b\u0448\u0435 \u0431\u044b\u043b \u043e\u043f\u0438\u0441\u0430\u043d \u043f\u0435\u0440\u0432\u044b\u0439 \u0438\u0437 <strong>\u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u044d\u0442\u0430\u043f\u043e\u0432 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u043a\u043e\u0434\u0430<\/strong>. \u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043c \u0438\u0445 \u0432\u0441\u0435:<\/p>\n<ol>\n<li>\n<p>\u041e\u0446\u0435\u043d\u043a\u0430 \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0438\u0441\u043a \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u044e\u0449\u0438\u0445 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u043e\u0440 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u0438 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041d\u0430 \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430?<\/strong><\/p>\n<ol>\n<li>\n<p><strong>\u041d\u0430 \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 PL\/SQL \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439<\/strong>. \u0421\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0445 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u0438\u0434\u0451\u0442 \u043e:  <\/p>\n<ul>\n<li>\n<p>\u041c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435\u043c \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>PL\/pgSQL &#8212; \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430 \u043d\u0451\u043c \u0432\u0441\u0451 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u044b\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0447\u0435\u043c \u043d\u0430 PL\/SQL.<\/p>\n<\/li>\n<li>\n<p><strong>\u041d\u0430 \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430.<\/strong> \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0431\u0438\u043b\u043b\u0438\u043d\u0433. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0442\u043e\u0438\u0442 \u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0432\u044b\u043d\u043e\u0441\u0435 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u043b\u0443\u0447\u0430\u0438: <\/p>\n<ol>\n<li>\n<p>\u041a\u043e\u0434\u0430 \u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u043e\u043d \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0432 \u0421\u0423\u0411\u0414-\u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a.<\/p>\n<\/li>\n<li>\n<p>\u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0421\u0423\u0411\u0414 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u0431\u044b\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0435\u0439. \u0422\u043e\u0433\u0434\u0430, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u043d\u0435 \u0432\u0441\u0451, \u0430 \u043b\u0438\u0448\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u0438 PostgreSQL<\/strong><\/p>\n<p>PostgreSQL &#8212; \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u0430\u044f \u0421\u0423\u0411\u0414, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0431\u0435\u0437 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u0434 \u044f\u0434\u0440\u0430.<\/p>\n<p><strong>\u041c\u043e\u0436\u043d\u043e<\/strong> <strong>\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0438\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C<\/strong>. \u041f\u043e\u043d\u0430\u0447\u0430\u043b\u0443 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0443\u0434\u043e\u0431\u043d\u043e, \u0437\u0430\u0442\u043e \u044d\u0442\u043e \u043e\u043f\u0440\u0430\u0432\u0434\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0431\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/trigger-example\"><u>\u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 PostgreSQL<\/u><\/a> \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C. \u0410 \u0432\u043e\u0442 <a href=\"https:\/\/www.percona.com\/blog\/2019\/08\/15\/faster-lightweight-trigger-function-in-c-for-postgresql\/\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a> \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421 \u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0422\u0430\u043a\u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u043e\u043a\u043b\u0430\u0434\u043e\u043c &#171;<a href=\"https:\/\/pgconf.ru\/2020\/262485\"><u>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f GiST \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438<\/u><\/a><u>&#171;<\/u>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 10 \u043c\u0438\u043d\u0443\u0442 \u0434\u043e 110 \u043c\u0441.<\/p>\n<p><strong>\u041c\u043e\u0436\u043d\u043e<\/strong> <strong>\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0438\u043c<\/strong>. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0435\u0439 <a href=\"https:\/\/postgis.net\/\"><u>PostGIS<\/u><\/a>. <\/p>\n<p><strong>\u0422\u0430\u043a\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u0445 <\/strong><a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/xaggr\"><strong>\u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/strong><\/a>. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/github.com\/wulczer\/first_last_agg\"><u>first_last_agg<\/u><\/a>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e <a href=\"https:\/\/livesql.oracle.com\/apex\/livesql\/file\/content_FP499O87G9NJ3CA3JKIJA5XM8.html\"><u>KEEP (DENSE_RANK LAST ORDER BY)<\/u><\/a>. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u044b\u043b \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0443\u043b\u044c <strong>first_last_agg<\/strong> \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u0443\u0431\u0440\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043f\u043e\u0434\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0438 \u0437\u0430\u043f\u0440\u043e\u0441, \u0440\u0430\u0431\u043e\u0442\u0430\u0432\u0448\u0438\u0439 \u0432 \u0421\u0423\u0411\u0414 Oracle 6 \u0447\u0430\u0441\u043e\u0432, \u0432 \u0421\u0423\u0411\u0414 PostgreSQL \u0441\u0442\u0430\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0437\u0430 15 \u043c\u0438\u043d\u0443\u0442.<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/xplang\">\u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/a>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 SQL \u0438 \u0421, \u043d\u043e \u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u0421\u0423\u0411\u0414 PostgreSQL \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0447\u0435\u0442\u044b\u0440\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430:<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/plpgsql\"><u>PL\/pgSQL<\/u><\/a><u>.<\/u><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/plperl\"><u>PL\/Perl<\/u><\/a><u>.<\/u><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/plpython\"><u>PL\/Python<\/u><\/a><u>.<\/u><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/pltcl\">PL\/Tcl<\/a>.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/strong><\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0447\u0430\u0441\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0421\u0423\u0411\u0414, \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u044e\u0449\u0438\u0445 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0432 \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0421\u0423\u0411\u0414:<\/p>\n<ol>\n<li>\n<p>C\u0442\u0430\u0440\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (APEX).<\/p>\n<\/li>\n<li>\n<p>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 HTTP.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 PL\/SQL \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b.<\/p>\n<\/li>\n<li>\n<p>Ref-\u043a\u0443\u0440\u0441\u043e\u0440.<\/p>\n<\/li>\n<li>\n<p>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u0430\u043a\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 MERGE \u0438 INSERT ALL.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 DECODE.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u043a.<\/p>\n<\/li>\n<li>\n<p>\u0410\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u0435 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438-\u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0434\u043b\u044f \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u0421\u0442\u0430\u0440\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446<\/strong><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043e\u0431\u043e\u0439\u0442\u0438 \u0432\u044b\u0448\u0435\u043d\u0430\u0437\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438. \u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/www.techonthenet.com\/oracle\/joins.php\"><u>\u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446<\/u><\/a>, \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u043d\u043e\u0432\u044b\u0439:<\/p>\n<ul>\n<li>\n<p>LEFT OUTER JOIN.<\/p>\n<\/li>\n<li>\n<p>JOIN.<\/p>\n<\/li>\n<li>\n<p>RIGHT OUTER JOIN.<\/p>\n<\/li>\n<li>\n<p>FULL OUTER JOIN.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u044f\u0437\u044b\u043a\u0430 ANSI SQL, \u043b\u0438\u0431\u043e, \u0435\u0441\u043b\u0438 \u0443 \u043a\u043e\u0433\u043e-\u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u0421\u0423\u0411\u0414 Oracle, \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441.<\/p>\n<p><strong>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/strong><\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0441 \u00ab\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f\u043c\u0438\u00bb \u0438 \u00ab\u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c\u0438\u00bb:  <\/p>\n<pre><code class=\"sql\">CREATE TABLE t_hierarchy (      id INT NOT NULL PRIMARY KEY,      parent INT NOT NULL,      value VARCHAR(50) NOT NULL ); \u00a0   INSERT INTO t_hierarchy (id, parent, VALUE)  SELECT s      , s \/ 5       , 'Value ' || s    FROM generate_series(1, 1000) s;   CREATE INDEX ix_hierarchy_parent ON t_hierarchy (parent);<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0421\u0423\u0411\u0414 Postgres. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0421\u0423\u0411\u0414 Oracle \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438 START\u00a0WITH, CONNECT BY PRIOR, \u043d\u043e \u0438 <a href=\"https:\/\/docs.oracle.com\/en\/database\/oracle\/oracle-database\/12.2\/sqlrf\/Hierarchical-Query-Pseudocolumns.html\"><u>\u043f\u0441\u0435\u0432\u0434\u043e\u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c\u0438<\/u><\/a>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u043c\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0438\u0437\u043d\u0430\u043a \u043b\u0438\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u0442 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u0442\u044c \u043e\u0442 \u043a\u043e\u0440\u043d\u044f \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u0443\u0437\u043b\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0421\u0423\u0411\u0414 PostgreSQL:<\/p>\n<pre><code class=\"pgsql\">WITH RECURSIVE ds(id, parent, value, lvl, path) AS ( SELECT h.id      , h.parent      , h.value      , 1 AS lvl      , ARRAY[h.id] AS path   FROM t_hierarchy h  WHERE h.parent = 0   UNION ALL  SELECT h.id      , h.parent      , h.value      , 1 AS lvl      , ARRAY[h.id] AS path   FROM ds d   JOIN t_hierarchy h     ON h.parent = d.id ) SELECT REPEAT('  ', d.lvl) || d.id AS id      , d.parent      , d.value      , d.lvl      , d.path::text AS path      , CASE WHEN d.lvl - LEAD(d.lvl) OVER(ORDER BY d.path) &lt; 0 THEN false ELSE true END AS is_leaf    FROM ds d  ORDER BY d.path;<\/code><\/pre>\n<p>\u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/queries-with#QUERIES-WITH-RECURSIVE\"><u>\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441<\/u><\/a>. \u041f\u043e\u043b\u0435 path \u0437\u0434\u0435\u0441\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u043c, \u0442.\u043a., c \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u044e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 path \u0432\u0430\u0436\u0435\u043d \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043b\u0438\u0441\u0442\u043e\u0432\u044b\u0445 \u0443\u0437\u043b\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0443\u0437\u043b\u0430 \u0435\u0441\u0442\u044c \u043f\u043e\u0442\u043e\u043c\u043a\u0438, \u0442\u043e \u043e\u043d \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u0441\u0442\u043e\u0432\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0443\u0437\u043b\u0430 \u043d\u0435\u0442 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432, \u0442\u043e \u043e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u0441\u0442\u043e\u0432\u044b\u043c.<\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u0430\u0441\u0441\u0438\u0432 path \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0443\u0442\u044c \u043e\u0442 \u043a\u043e\u0440\u043d\u044f \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443. \u0423\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0443\u0442\u0451\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u043a \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0443\u0440\u043e\u0432\u043d\u044e.<\/p>\n<p><strong>\u0417\u0430\u0446\u0438\u043a\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 PostgreSQL<\/strong>  <\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0443 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 PostgreSQL \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0435 \u043d\u044e\u0430\u043d\u0441\u044b. \u0412 \u0421\u0423\u0411\u0414 Oracle \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f <a href=\"https:\/\/www.oraexcel.com\/database-oracle-11gR2-ORA-24451\"><u>\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438<\/u><\/a> &#8212; \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0430, \u0442\u043e Oracle \u0441\u0447\u0438\u0442\u0430\u0435\u0442, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u043b\u0441\u044f, \u0438 \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f. <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/queries-with#QUERIES-WITH-RECURSIVE\"><u>\u0412 \u0421\u0423\u0411\u0414 Postgres \u0434\u043e 14-\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u0442\u0430\u043a<\/u><\/a> &#8212; \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0433 \u0432\u043e\u0439\u0442\u0438 \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u043b\u0438 \u043a\u043e\u043f\u0438\u0442\u044c\u0441\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043e\u0447\u0438\u0449\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0410 \u043e\u043d \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043b\u0441\u044f \u043d\u0435 \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u043e \u043d\u0430 \u0434\u0438\u0441\u043a\u0435.<\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430, \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e\u043b\u044f <strong>dss_key<\/strong> \u0438 <strong>dss_parent_key<\/strong> \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e74\/463\/504\/e744635047989acbe9f7f18ee3b90d2e.png\" width=\"515\" height=\"115\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e74\/463\/504\/e744635047989acbe9f7f18ee3b90d2e.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u043d\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u0421\u0423\u0411\u0414 PostgreSQL\u00a0NULL \u0438 \u043f\u0443\u0441\u0442\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u044d\u0442\u043e \u043d\u0435 \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 (\u043d\u0430 \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0439 PGConf.Russia \u0431\u044b\u043b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d <a href=\"https:\/\/pgconf.ru\/2022\/316638\"><u>\u0434\u043e\u043a\u043b\u0430\u0434 \u043e NULL-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445<\/u><\/a>).<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e <strong>\u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u0446\u0438\u043a\u043b\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e<\/strong>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u044f\u0436\u0435\u043b\u043e \u043e\u0442\u043b\u043e\u0432\u0438\u0442\u044c, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u043e\u0447\u0435\u043d\u044c \u043e\u0431\u044a\u0451\u043c\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 \u043d\u0430 \u0442\u044b\u0441\u044f\u0447\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0432 14-\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 CYCLE SET USING, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0446\u0438\u043a\u043b\u043e\u0432. \u0412 \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438:<\/p>\n<ol>\n<li>\n<p>\u0412 CYCLE \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u0442\u044c\u0441\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0412 SET \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0441 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0446\u0438\u043a\u043b\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0412 USING \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u043e\u043b\u0431\u0435\u0446, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0443\u0442\u044c.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432:<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/550632\/\"><u>PostgreSQL 14: \u0427\u0430\u0441\u0442\u044c 5 \u0438\u043b\u0438 \u00ab\u0432\u0435\u0441\u0435\u043d\u043d\u0438\u0435 \u0437\u0430\u043c\u043e\u0440\u043e\u0437\u043a\u0438\u00bb (\u041a\u043e\u043c\u043c\u0438\u0442\u0444\u0435\u0441\u0442 2021-03)<\/u><\/a><u>.<\/u><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/commitfest.postgresql.org\/32\/2570\/\"><u>\u0424\u0440\u0430\u0437\u044b CYCLE \u0438 SEARCH \u0434\u043b\u044f \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/u><\/a><u>.<\/u><\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Oracle<\/strong><\/p>\n<p>\u0412 \u0421\u0423\u0411\u0414 Oracle \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<ol>\n<li>\n<p><strong>\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430 \u0434\u043b\u044f \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 <\/strong><a href=\"https:\/\/ittutorial.org\/parallel-hint-in-oracle\/\"><strong><u>PARALLEL<\/u><\/strong><\/a><strong>.<\/strong>\u00a0 (\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430-\u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0440\u0430).<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.oracle.com\/database\/121\/ARPLS\/d_parallel_ex.htm\"><strong><u>DBMS_PARALLEL_EXECUTE<\/u><\/strong><\/a>. (\u041f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432 Oracle 11, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 DBMS_SCHEDULER).<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.oracle.com\/en\/database\/oracle\/oracle-database\/21\/arpls\/DBMS_SCHEDULER.html\"><strong><u>DBMS_SCHEDULER<\/u><\/strong><\/a>.\u0427\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0432 Oracle 10 \u0434\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430 DBMS_PARALLEL_EXECUTE. \u0414\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u043b\u0438 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u044f, \u043e\u043d\u0438 \u0441\u0442\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u0432 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c, \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c \u0438\u0445 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435. \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u044f\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b, \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438\u0441\u044c. \u0418\u043d\u043e\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 PostgreSQL<\/strong><\/p>\n<p>\u0412 \u0421\u0423\u0411\u0414 Oracle \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430 \u0434\u043b\u044f \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 <a href=\"https:\/\/docs.oracle.com\/cd\/E11882_01\/server.112\/e41573\/hintsref.htm#CHDJIGDG\"><u>PARALLEL<\/u><\/a> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 <a href=\"#i2129904\">\u043e\u0431\u0449\u0435\u0435 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435<\/a> \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443 PARALLEL. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438, \u0430 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435\u0442.<\/p>\n<p>\u0412 PostgreSQL\u00a0\u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c <a href=\"https:\/\/postgrespro.ru\/docs\/postgrespro\/14\/parallel-query\"><u>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430<\/u><\/a>, \u043d\u043e \u043e\u043d\u043e <a href=\"https:\/\/postgrespro.ru\/docs\/enterprise\/14\/pg-hint-plan\"><u>\u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f pg_hint_plan \u043d\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0430<\/u><\/a>:<\/p>\n<ol>\n<li>\n<p>\u0412\u043d\u0435\u0448\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f VALUES.<\/p>\n<\/li>\n<li>\n<p>CTE.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<\/li>\n<\/ol>\n<p> \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, <strong>\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 PARALLEL<\/strong>, \u0435\u0441\u043b\u0438:<\/p>\n<ol>\n<li>\n<p>\u0427\u0430\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432 \u0435\u0451 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438\u00a0<a href=\"https:\/\/postgrespro.ru\/docs\/postgrespro\/14\/runtime-config-resource\"><u>max_parallel_workers_per_gather<\/u><\/a>: SET\u00a0max_parallel_workers_per_gather\u00a0TO\u00a0num_workers. <\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043f\u0440\u0438\u043c\u0435\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0444\u043e\u043d\u043e\u0432\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p><strong>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0430\u043a\u0435\u0442\u0430 DBMS_PARALLEL_EXECUTE<\/strong> <strong>\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c <\/strong><a href=\"https:\/\/github.com\/vibhorkum\/pg_background\"><strong><u>pg_background<\/u><\/strong><\/a>. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0444\u043e\u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445\u00a0\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043a\u043e\u0434. \u041c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0438\u0445 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b. \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438.<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 DBMS_PARALLEL_EXECUTE \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 DBMS_SCHEDULER, \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e <strong>\u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c <\/strong><a href=\"https:\/\/github.com\/citusdata\/pg_cron\"><strong><u>pg_cron<\/u><\/strong><\/a><strong>, \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043c\u043e\u0434\u0443\u043b\u044c <\/strong><a href=\"https:\/\/postgrespro.ru\/docs\/enterprise\/14\/pgpro-scheduler\"><strong><u>pgpro_scheduler<\/u><\/strong><\/a>, \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0439 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 <a href=\"https:\/\/postgrespro.ru\/products\/postgrespro\/enterprise\"><u>Postgres Pro Enterprise<\/u><\/a>. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u043e\u0432 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a Java, C#, Golang.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435, \u043f\u043e\u043b\u044c\u0437\u0443\u044f\u0441\u044c \u0441\u043b\u0443\u0447\u0430\u0435\u043c, <strong>\u0441\u0442\u043e\u0438\u0442 \u0440\u0430\u0437\u0432\u0435\u044f\u0442\u044c \u043c\u0438\u0444 \u043e <\/strong><a href=\"https:\/\/github.com\/postgres\/pgagent\"><strong><u>pgAgent<\/u><\/strong><\/a> &#8212; \u0435\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0435 \u043c\u043d\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 <a href=\"https:\/\/github.com\/postgres\/pgadmin4\"><u>pgAdmin<\/u><\/a>. \u042d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0438\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 PL\/pgSQL \u0438 C++. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<ol>\n<li>\n<p>\u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0439 \u0437\u0430\u0434\u0430\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0438\u0441\u043a \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ol>\n<p>\u0410\u0433\u0435\u043d\u0442 &#8212; \u0444\u043e\u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043b\u043e\u0433\u0438\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043d\u0430\u0431\u043e\u0440\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a <a href=\"https:\/\/www.boost.org\/doc\/\"><u>libboost<\/u><\/a>. \u041d\u0430 \u041e\u0421 Astra\u00a0Linux\u00a0Smolensk 1.6 \u0434\u043e\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0441\u0442\u0430\u0432\u0438\u0442\u044c pgAgent\u00a0\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u0442\u0430\u043c \u0432\u043f\u043e\u043b\u043d\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u0430\u043a\u0435\u0442\u044b libboost \u0442\u0430\u043c \u0435\u0441\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e.<\/p>\n<p><strong>\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0432 \u0441\u0435\u043a\u0446\u0438\u044f\u0445 WHERE<\/strong><\/p>\n<p>\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438<strong>\u00a0<\/strong>\u0432 \u0441\u0435\u043a\u0446\u0438\u044f\u0445 WHERE \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c\u0438. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0421\u0423\u0411\u0414 PostgreSQL \u0431\u044b\u0432\u0430\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0447\u0438\u0432\u043e\u0441\u0442\u0438. <\/p>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 (<a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/xfunc-volatility\"><u>IMMUTABLE<\/u><\/a>) \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438 \u043e\u0434\u043d\u043e\u043c \u0438 \u0442\u043e\u043c \u0436\u0435 \u043d\u0430\u0431\u043e\u0440\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. <strong>\u0422\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/strong>. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u0430\u0441\u0447\u0451\u0442\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a  \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u043f\u043b\u0430\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (<strong>STABLE<\/strong> \u0438 <strong>VOLATILE<\/strong>). \u0422\u043e\u0433\u0434\u0430 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432.<\/p>\n<p><a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/functions-conditional#FUNCTIONS-NULLIF\"><u>NULLIF<\/u><\/a><strong>\u00a0\u0434\u043e 14-\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438<\/strong>\u00a0\u0432\u043e\u043e\u0431\u0449\u0435\u00a0\u0441\u0442\u043e\u0438\u0442\u00a0\u0437\u0430\u043c\u0435\u043d\u044f\u0442\u044c\u00a0\u043d\u0430\u00a0<strong>col_name IS NOT NULL AND col_name != \u2018\u2019<\/strong>. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0434\u043b\u044f \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u0442\u043e \u043f\u043e \u043d\u0435\u043c\u0443 \u043d\u0438\u0447\u0435\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u0442\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u0435\u0442\u044c \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0443\u0447\u0442\u0435\u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0442\u0430\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e, \u0442\u043e \u0432 \u043f\u043b\u0430\u043d\u0435 \u0447\u0430\u0441\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0443\u0431\u0440\u0430\u043d\u043e.<\/p>\n<p>\u0421 14-\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0441\u0442\u0430\u043b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f NULLIF \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430:<\/p>\n<pre><code class=\"pgsql\">EXPLAIN (ANALYZE, TIMING OFF, COSTS OFF, SUMMARY OFF) SELECT * FROM tickets WHERE NULLIF(1, 2) = 2;             QUERY PLAN            --------------------------------  Result (actual rows=0 loops=1)    One-Time Filter: false<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, <strong>\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0441\u0447\u0451\u0442\u043d\u044b\u043c \u0438 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u0442\u0440\u043e\u043a<\/strong> \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0443\u0437\u043b\u0430\u0445 \u043f\u043b\u0430\u043d\u0430. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u043c\u0443 \u0432\u044b\u0431\u043e\u0440\u0443 \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0434\u0430\u043d\u043d\u044b\u043c, \u043d\u043e \u0438 \u043a \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u043c\u0443 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432. \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u043e, \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u043b\u0430\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439<\/strong><\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 &#8212; \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>select for update skip locked, \u043c\u043e\u0434\u0443\u043b\u044c <\/strong><a href=\"https:\/\/github.com\/pgq\/pgq\"><strong><u>pgq<\/u><\/strong><\/a><strong>.<\/strong> \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043b\u0438 \u043e\u043d\u0430 \u0431\u0438\u0437\u043d\u0435\u0441-\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c. <\/p>\n<p><strong>\u041e\u0447\u0435\u0440\u0435\u0434\u044c \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/strong> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/kafka.apache.org\/24\/documentation.html\"><u>Apache Kafka<\/u><\/a>, <a href=\"https:\/\/activemq.apache.org\/components\/classic\/documentation\"><u>Apache ActiveMQ<\/u><\/a>, <a href=\"https:\/\/www.rabbitmq.com\/documentation.html\"><u>RabbitMQ<\/u><\/a>\u00a0\u0438\u00a0<a href=\"http:\/\/www.pythondoc.com\/celery-3.1.11\/getting-started\/introduction.html\"><u>Celery<\/u><\/a>. \u042d\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b \u043d\u0430 \u0440\u044b\u043d\u043a\u0435 \u0438 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u0432\u044b\u0441\u043e\u043a\u043e \u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445.<\/p>\n<p><strong>\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/strong><\/p>\n<p>\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0442\u0438\u043f\u0430 <a href=\"https:\/\/apex.oracle.com\/en\/learn\/documentation\/\"><u>APEX<\/u><\/a> \u0432 PostgreSQL\u00a0<strong>\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442<\/strong>. \u042d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0430 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c &#8212; \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u043c \u043a\u043e\u0434\u0435, JavaScript, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043b\u043e\u0433\u0438\u043a\u0438. <strong>\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/strong>.<\/p>\n<p><strong>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 HTTP<\/strong><\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 HTTP, \u0442\u043e \u0442\u0443\u0442 \u0434\u0430\u0436\u0435 \u0432 \u0421\u0423\u0411\u0414 Oracle \u0435\u0441\u0442\u044c \u043d\u044e\u0430\u043d\u0441. \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 11, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043c\u0443-\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c <a href=\"https:\/\/www.oracle.com\/technetwork\/database\/security\/ovw-oracle-database-firewall-1447166.pdf\"><u>\u0444\u0430\u0439\u0435\u0440\u0432\u043e\u043b\u0435 Oracle<\/u><\/a>. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043b\u044e\u0431\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0430 \u0421\u0423\u0411\u0414.<\/p>\n<p>\u0412 PL\/pgSQL \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f, \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0438\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u044e\u0431\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0435\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0415\u0441\u043b\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0432\u0435\u0449\u044c \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, <strong>\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:<\/strong><\/p>\n<ol>\n<li>\n<p><strong>\u041c\u043e\u0434\u0443\u043b\u044c \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>pl\/python.<\/strong><\/p>\n<\/li>\n<li>\n<p><strong>pl\/perl.<\/strong><\/p>\n<\/li>\n<\/ol>\n<p>\u0415\u0441\u043b\u0438 \u0445\u0440\u0430\u043d\u0438\u043c\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 \u043e\u0442 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043e\u0442 \u043d\u0435\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c. \u041e\u0442\u043a\u0430\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u043e\u0442\u043a\u0430\u0437\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u0442\u043a\u0430\u0437\u0430\u043b, \u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0435\u0439 \u043e\u0442 \u043d\u0435\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u0447\u0442\u043e, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441\u0442\u0440\u043e\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c \u043e\u0447\u0438\u0441\u0442\u043a\u0438.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u0430\u043c \u0432\u044b\u0437\u043e\u0432 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c, \u0430 \u043f\u043e\u0440\u043e\u0434\u0438\u0432\u0448\u0430\u044f \u0435\u0433\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u043c\u0435\u043d\u0435\u043d\u0430. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043f\u043b\u043e\u0445\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432.<\/p>\n<p><strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 PL\/SQL \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/strong><\/p>\n<p>\u0412\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b (<a href=\"https:\/\/www.oracletutorial.com\/plsql-tutorial\/plsql-nested-tables\/\"><u>nested tables<\/u><\/a>) \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0438\u043b\u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432.<\/p>\n<p>\u0410\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b &#8212; <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/hstore\"><u>hstore<\/u><\/a> \u0438\u043b\u0438\u00a0<a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/datatype-json#JSON-KEYS-ELEMENTS\"><u>JSONB<\/u><\/a>.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 Postgres, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 Oracle, <strong>\u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441 \u0442\u0438\u043f\u043e\u043c record<\/strong> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u0445 \u0442\u0438\u043f\u0430\u00a0<a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/plpgsql-control-structures\"><u>for rec in (query) loop<\/u><\/a>. <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432\u0430\u0436\u043d\u043e, \u0447\u0442\u043e <strong>\u0432 PL\/pgSQL \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (<\/strong><a href=\"https:\/\/www.tutorialspoint.com\/plsql\/plsql_object_oriented.htm\"><strong><u>\u041e\u041e\u041f<\/u><\/strong><\/a><strong>)<\/strong>. \u0415\u0441\u043b\u0438 \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u044f\u0437\u0430\u043d\u0430 \u043d\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b\u00a0\u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442\u043e \u044d\u0442\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c.<\/p>\n<p><strong>Bulk collect<\/strong><\/p>\n<p><a href=\"https:\/\/blogs.oracle.com\/connect\/post\/bulk-processing-with-bulk-collect-and-forall\"><u>bulk collect<\/u><\/a>\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0421\u0423\u0411\u0414 Oracle \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0438 <strong>\u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0441 PL\/SQL-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0430 SQL-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442<\/strong>. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u0442\u0435\u043c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b. \u041f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c:<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u043f\u043b\u0430\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u0435\u0448\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043b\u0430\u043d\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441, \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043b\u0430\u043d \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u044d\u0448 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043c\u0435\u043d\u044b bulk collect \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u0441\u0441\u0438\u0432\u0430:<\/p>\n<pre><code class=\"pgsql\">CREATE OR REPLACE FUNCTION bulk_test() RETURNS VOID AS $$ DECLARE    a tb_person[]; BEGIN    a := array(SELECT tb_person FROM tb_person);    ... END; $$ LANGUAGE plpgsql;<\/code><\/pre>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u043c\u044f\u0442\u044c. \u0421\u0423\u0411\u0414 PostgreSQL \u043d\u0435 \u0434\u0430\u0451\u0442 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 1 \u0413\u0411 \u043f\u0430\u043c\u044f\u0442\u0438 \u0437\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u0411\u044b\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u044a\u0451\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u043b 1 \u0413\u0411, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435, \u0447\u0430\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0438 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0430\u0441\u044c.<\/p>\n<p><strong>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b<\/strong><\/p>\n<p>\u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0441 \u0442\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0435 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f, \u0437\u043d\u0430\u0447\u0438\u0442, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0444\u043e\u0440\u043c\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0445 (IMMUTABLE) \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b\/\u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u043e \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 DECLARE:<\/p>\n<pre><code class=\"pgsql\">DO $$ DECLARE   msg constant text := 'Message 1'; BEGIN   RAISE NOTICE '%', msg; END $$ LANGUAGE plpgsql;<\/code><\/pre>\n<p><strong>Ref-\u043a\u0443\u0440\u0441\u043e\u0440\u044b<\/strong><\/p>\n<p>\u0412 \u0421\u0423\u0411\u0414 PostgreSQL \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0438\u043f\u0430\u00a0<a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/plpgsql-cursors\"><u>refcursor<\/u><\/a>\u00a0\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0451 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u00a0\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e\u0442 ref-\u043a\u0443\u0440\u0441\u043e\u0440. \u0412\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442:<\/p>\n<pre><code class=\"pgsql\">CREATE OR REPLACE FUNCTION get_employees_by_deptno (     p_deptno IN emp.deptno%TYPE,      p_rset REFCURSOR )  RETURNS REFCURSOR AS  $$  BEGIN      OPEN p_rset FOR     SELECT empno        , ename       FROM emp      WHERE deptno = p_deptno      ORDER BY ename;       RETURN p_rset; END; $$ LANGUAGE plpgsql STABLE;<\/code><\/pre>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439, <a href=\"https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/683764\/\">\u0447\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043d\u044b \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0421\u0423\u0411\u0414 Oracle, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u0431\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0443\u0442\u0438 \u0438\u0437-\u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u044f\u043c\u044b\u0445 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 \u0432 \u0421\u0423\u0411\u0414 PostgreSQL. \u042d\u0442\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0449\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0446\u0438\u043a\u043b\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u0432\u044b\u0431\u043e\u0440 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u0438 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0430.<\/p>\n<\/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\/683748\/\"> https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/683748\/<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438\u00a0\u0441 Oracle \u043d\u0430 Postgres \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e (<a href=\"https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/676792\/\">\u0447\u0430\u0441\u0442\u044c 1<\/a>, <a href=\"https:\/\/habr.com\/ru\/company\/postgrespro\/blog\/679808\/\">\u0447\u0430\u0441\u0442\u044c 2<\/a>).  \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u043f\u043e\u0439\u0434\u0451\u0442 \u043e\u0431 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u043c \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043c\u0435\u043d\u044b \u0421\u0423\u0411\u0414. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b:<\/p>\n<ol>\n<li>\n<p>\u041a\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0441\u0442\u043e\u0438\u0442 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043d\u0430 PostgreSQL.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0437\u0430\u043c\u0435\u043d\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0421\u0423\u0411\u0414 \u043f\u0440\u0438 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0432 \u0421\u0423\u0411\u0414-\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 <a href=\"https:\/\/docs.oracle.com\/en\/database\/oracle\/oracle-database\/21\/lnpls\/index.html\"><strong><u>PL\/SQL<\/u><\/strong><\/a><strong> \u043d\u0430 <\/strong><a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/plpgsql\"><strong><u>PL\/pgSQL<\/u><\/strong><\/a>. \u041a\u043e\u0434 \u043d\u0430 PL\/SQL\u00a0<a href=\"https:\/\/www.orafaq.com\/node\/2899\"><u>\u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434 \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c<\/u><\/a><u>, <\/u>\u0430 \u043a\u043e\u0434 \u043d\u0430 PL\/pgSQL \u043d\u0435\u043b\u044c\u0437\u044f. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u043c\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b PL\/SQL \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0431\u0449\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u044f\u0434\u0440\u043e\u043c \u041e\u0421, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. <\/p>\n<p>\u0421\u0442\u0435\u043f\u0435\u043d\u044c \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e PL\/SQL. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0431\u0430\u0437\u044b, \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0438\u0445 (\u0446\u0438\u043a\u043b\u044b, \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b, \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438).<\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 PL\/SQL \u044f\u0437\u044b\u043a\u0430 PL\/pgSQL \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 prosrc \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/catalog-pg-proc\"><u>pg_proc<\/u><\/a>. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043a\u043e\u0439, \u043a\u0430\u043a\u043e\u0439 \u043e\u043d \u0431\u044b\u043b \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/sql-createfunction\">CREATE FUNCTION<\/a> \u0438\/\u0438\u043b\u0438 <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/sql-createprocedure\">CREATE PROCEDURE<\/a>. \u041a\u043e\u0433\u0434\u0430 \u0441\u0435\u0441\u0441\u0438\u044f \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0442\u043e:<\/p>\n<ol>\n<li>\n<p>\u0415\u0451 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u0440\u0435\u0432\u043e \u0440\u0430\u0437\u0431\u043e\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u043e\u0439\u0442\u0438 \u0435\u0433\u043e \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u043c\u0443. <\/p>\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u043f\u0440\u043e\u0441 \u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0435\u0441\u044c \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043a\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0421\u0423\u0411\u0414-\u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430. \u0415\u0441\u043b\u0438 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043a\u043e\u0434 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f,\u00a0\u0442\u043e \u043c\u043e\u0436\u043d\u043e:<\/p>\n<ol>\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.  <\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u00ab\u0443\u043c\u043d\u044b\u0439\u00bb \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0442\u043e\u0442 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0411\u0414.<\/p>\n<\/li>\n<\/ol>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438, \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0430 \u043d\u0435 \u043d\u0430 PL\/pgSQL. <\/p>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0442\u0430\u043a\u0430\u044f: \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e \u0421\u0423\u0411\u0414 \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u0442\u0430\u0440\u0430\u044e\u0442\u0441\u044f \u0432\u0437\u044f\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0431\u044b\u043b \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0435\u043d \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0421\u0423\u0411\u0414, \u0438 <strong>\u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u043e\u0432\u043e\u0439 \u0421\u0423\u0411\u0414 \u0442\u0430\u043a, \u043a\u0430\u043a \u0443\u0436\u0435 \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u0441 \u043f\u0440\u0435\u0436\u043d\u0435\u0439<\/strong>. \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0439 \u0421\u0423\u0411\u0414. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u0442\u043e \u043f\u0440\u043e\u0435\u043a\u0442, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c.<\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442<strong> \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0431\u0435\u0437\u0434\u0443\u043c\u043d\u043e \u0438\u0437 Oracle \u0432 Postgres, \u0430 \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u043e\u0432\u043e\u0439 \u0421\u0423\u0411\u0414 (\u00ab\u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a\u0430\u00bb)<\/strong>. \u0423 \u043b\u044e\u0431\u043e\u0439 \u0421\u0423\u0411\u0414 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0441 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e Postgres \u0440\u0435\u0448\u0430\u0435\u0442 \u0441\u0432\u043e\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0435 \u0445\u0443\u0436\u0435 Oracle, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u0430\u0436\u0435 \u043b\u0443\u0447\u0448\u0435 &#8212; \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e\u043b\u043d\u043e\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0435\u043e\u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0436\u0435\u043d \u043a\u043e\u0434 PL\/SQL \u2013 \u0440\u0430\u0441\u0447\u0451\u0442\u044b \u0431\u0438\u043b\u043b\u0438\u043d\u0433\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043d\u043e\u0433\u043e.<\/p>\n<p>\u0412\u044b\u0448\u0435 \u0431\u044b\u043b \u043e\u043f\u0438\u0441\u0430\u043d \u043f\u0435\u0440\u0432\u044b\u0439 \u0438\u0437 <strong>\u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u044d\u0442\u0430\u043f\u043e\u0432 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u043a\u043e\u0434\u0430<\/strong>. \u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043c \u0438\u0445 \u0432\u0441\u0435:<\/p>\n<ol>\n<li>\n<p>\u041e\u0446\u0435\u043d\u043a\u0430 \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0438\u0441\u043a \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u044e\u0449\u0438\u0445 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u043e\u0440 \u0441\u0440\u0435\u0434\u0441\u0442\u0432 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u0438 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041d\u0430 \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430?<\/strong><\/p>\n<ol>\n<li>\n<p><strong>\u041d\u0430 \u0447\u0430\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 PL\/SQL \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439<\/strong>. \u0421\u0442\u043e\u0438\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0445 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u0438\u0434\u0451\u0442 \u043e:  <\/p>\n<ul>\n<li>\n<p>\u041c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447 \u0432 \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435\u043c \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<\/li>\n<\/ul>\n<p>PL\/pgSQL &#8212; \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430 \u043d\u0451\u043c \u0432\u0441\u0451 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u044b\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0447\u0435\u043c \u043d\u0430 PL\/SQL.<\/p>\n<\/li>\n<li>\n<p><strong>\u041d\u0430 \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430.<\/strong> \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0431\u0438\u043b\u043b\u0438\u043d\u0433. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0442\u043e\u0438\u0442 \u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0432\u044b\u043d\u043e\u0441\u0435 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u043b\u0443\u0447\u0430\u0438: <\/p>\n<ol>\n<li>\n<p>\u041a\u043e\u0434\u0430 \u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u043e\u043d \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0432 \u0421\u0423\u0411\u0414-\u043f\u0440\u0438\u0451\u043c\u043d\u0438\u043a.<\/p>\n<\/li>\n<li>\n<p>\u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0421\u0423\u0411\u0414 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u0431\u044b\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u041c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0435\u0439. \u0422\u043e\u0433\u0434\u0430, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u043d\u0435 \u0432\u0441\u0451, \u0430 \u043b\u0438\u0448\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u043c\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u0438 PostgreSQL<\/strong><\/p>\n<p>PostgreSQL &#8212; \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u0430\u044f \u0421\u0423\u0411\u0414, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u0448\u0438\u0440\u043e\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0431\u0435\u0437 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u0434 \u044f\u0434\u0440\u0430.<\/p>\n<p><strong>\u041c\u043e\u0436\u043d\u043e<\/strong> <strong>\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0438\u00a0\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C<\/strong>. \u041f\u043e\u043d\u0430\u0447\u0430\u043b\u0443 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0443\u0434\u043e\u0431\u043d\u043e, \u0437\u0430\u0442\u043e \u044d\u0442\u043e \u043e\u043f\u0440\u0430\u0432\u0434\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0431\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/trigger-example\"><u>\u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 PostgreSQL<\/u><\/a> \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C. \u0410 \u0432\u043e\u0442 <a href=\"https:\/\/www.percona.com\/blog\/2019\/08\/15\/faster-lightweight-trigger-function-in-c-for-postgresql\/\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a> \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421 \u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u0422\u0430\u043a\u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u043e\u043a\u043b\u0430\u0434\u043e\u043c &#171;<a href=\"https:\/\/pgconf.ru\/2020\/262485\"><u>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f GiST \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438<\/u><\/a><u>&#171;<\/u>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 10 \u043c\u0438\u043d\u0443\u0442 \u0434\u043e 110 \u043c\u0441.<\/p>\n<p><strong>\u041c\u043e\u0436\u043d\u043e<\/strong> <strong>\u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0438\u043c<\/strong>. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0435\u0439 <a href=\"https:\/\/postgis.net\/\"><u>PostGIS<\/u><\/a>. <\/p>\n<p><strong>\u0422\u0430\u043a\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u0445 <\/strong><a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/xaggr\"><strong>\u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/strong><\/a>. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/github.com\/wulczer\/first_last_agg\"><u>first_last_agg<\/u><\/a>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e <a href=\"https:\/\/livesql.oracle.com\/apex\/livesql\/file\/content_FP499O87G9NJ3CA3JKIJA5XM8.html\"><u>KEEP (DENSE_RANK LAST ORDER BY)<\/u><\/a>. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u044b\u043b \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0434\u0443\u043b\u044c <strong>first_last_agg<\/strong> \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b \u0443\u0431\u0440\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043f\u043e\u0434\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0438 \u0437\u0430\u043f\u0440\u043e\u0441, \u0440\u0430\u0431\u043e\u0442\u0430\u0432\u0448\u0438\u0439 \u0432 \u0421\u0423\u0411\u0414 Oracle 6 \u0447\u0430\u0441\u043e\u0432, \u0432 \u0421\u0423\u0411\u0414 PostgreSQL \u0441\u0442\u0430\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0437\u0430 15 \u043c\u0438\u043d\u0443\u0442.<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/xplang\">\u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/a>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 SQL \u0438 \u0421, \u043d\u043e \u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u0421\u0423\u0411\u0414 PostgreSQL \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0447\u0435\u0442\u044b\u0440\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430:<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/plpgsql\"><u>PL\/pgSQL<\/u><\/a><u>.<\/u><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/plperl\"><u>PL\/Perl<\/u><\/a><u>.<\/u><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/plpython\"><u>PL\/Python<\/u><\/a><u>.<\/u><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/pltcl\">PL\/Tcl<\/a>.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/strong><\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0447\u0430\u0441\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0421\u0423\u0411\u0414, \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u044e\u0449\u0438\u0445 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0432 \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u0421\u0423\u0411\u0414:<\/p>\n<ol>\n<li>\n<p>C\u0442\u0430\u0440\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u043b\u043e\u0432\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0435\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (APEX).<\/p>\n<\/li>\n<li>\n<p>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 HTTP.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 PL\/SQL \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b.<\/p>\n<\/li>\n<li>\n<p>Ref-\u043a\u0443\u0440\u0441\u043e\u0440.<\/p>\n<\/li>\n<li>\n<p>\u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u0430\u043a\u0435\u0442\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 MERGE \u0438 INSERT ALL.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 DECODE.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u043a.<\/p>\n<\/li>\n<li>\n<p>\u0410\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u044b\u0435 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438-\u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0434\u043b\u044f \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u0421\u0442\u0430\u0440\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446<\/strong><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043e\u0431\u043e\u0439\u0442\u0438 \u0432\u044b\u0448\u0435\u043d\u0430\u0437\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438. \u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/www.techonthenet.com\/oracle\/joins.php\"><u>\u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446<\/u><\/a>, \u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u043d\u043e\u0432\u044b\u0439:<\/p>\n<ul>\n<li>\n<p>LEFT OUTER JOIN.<\/p>\n<\/li>\n<li>\n<p>JOIN.<\/p>\n<\/li>\n<li>\n<p>RIGHT OUTER JOIN.<\/p>\n<\/li>\n<li>\n<p>FULL OUTER JOIN.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u044f\u0437\u044b\u043a\u0430 ANSI SQL, \u043b\u0438\u0431\u043e, \u0435\u0441\u043b\u0438 \u0443 \u043a\u043e\u0433\u043e-\u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u0421\u0423\u0411\u0414 Oracle, \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441.<\/p>\n<p><strong>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/strong><\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0441 \u00ab\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f\u043c\u0438\u00bb \u0438 \u00ab\u043f\u043e\u0442\u043e\u043c\u043a\u0430\u043c\u0438\u00bb:  <\/p>\n<pre><code class=\"sql\">CREATE TABLE t_hierarchy (      id INT NOT NULL PRIMARY KEY,      parent INT NOT NULL,      value VARCHAR(50) NOT NULL ); \u00a0   INSERT INTO t_hierarchy (id, parent, VALUE)  SELECT s      , s \/ 5       , 'Value ' || s    FROM generate_series(1, 1000) s;   CREATE INDEX ix_hierarchy_parent ON t_hierarchy (parent);<\/code><\/pre>\n<p>\u041f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0421\u0423\u0411\u0414 Postgres. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0421\u0423\u0411\u0414 Oracle \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438 START\u00a0WITH, CONNECT BY PRIOR, \u043d\u043e \u0438 <a href=\"https:\/\/docs.oracle.com\/en\/database\/oracle\/oracle-database\/12.2\/sqlrf\/Hierarchical-Query-Pseudocolumns.html\"><u>\u043f\u0441\u0435\u0432\u0434\u043e\u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c\u0438<\/u><\/a>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u043c\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0438\u0437\u043d\u0430\u043a \u043b\u0438\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u0442 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0443\u0442\u044c \u043e\u0442 \u043a\u043e\u0440\u043d\u044f \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u0443\u0437\u043b\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0423\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 \u0421\u0423\u0411\u0414 PostgreSQL:<\/p>\n<pre><code class=\"pgsql\">WITH RECURSIVE ds(id, parent, value, lvl, path) AS ( SELECT h.id      , h.parent      , h.value      , 1 AS lvl      , ARRAY[h.id] AS path   FROM t_hierarchy h  WHERE h.parent = 0   UNION ALL  SELECT h.id      , h.parent      , h.value      , 1 AS lvl      , ARRAY[h.id] AS path   FROM ds d   JOIN t_hierarchy h     ON h.parent = d.id ) SELECT REPEAT('  ', d.lvl) || d.id AS id      , d.parent      , d.value      , d.lvl      , d.path::text AS path      , CASE WHEN d.lvl - LEAD(d.lvl) OVER(ORDER BY d.path) &lt; 0 THEN false ELSE true END AS is_leaf    FROM ds d  ORDER BY d.path;<\/code><\/pre>\n<p>\u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/queries-with#QUERIES-WITH-RECURSIVE\"><u>\u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441<\/u><\/a>. \u041f\u043e\u043b\u0435 path \u0437\u0434\u0435\u0441\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u043c, \u0442.\u043a., c \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u044e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0430\u044f \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 path \u0432\u0430\u0436\u0435\u043d \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043b\u0438\u0441\u0442\u043e\u0432\u044b\u0445 \u0443\u0437\u043b\u043e\u0432:<\/p>\n<ol>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0443\u0437\u043b\u0430 \u0435\u0441\u0442\u044c \u043f\u043e\u0442\u043e\u043c\u043a\u0438, \u0442\u043e \u043e\u043d \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u0441\u0442\u043e\u0432\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0443\u0437\u043b\u0430 \u043d\u0435\u0442 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432, \u0442\u043e \u043e\u043d \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438\u0441\u0442\u043e\u0432\u044b\u043c.<\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u0430\u0441\u0441\u0438\u0432 path \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0443\u0442\u044c \u043e\u0442 \u043a\u043e\u0440\u043d\u044f \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443. \u0423\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0443\u0442\u0451\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u043a \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0443\u0440\u043e\u0432\u043d\u044e.<\/p>\n<p><strong>\u0417\u0430\u0446\u0438\u043a\u043b\u0438\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 PostgreSQL<\/strong>  <\/p>\n<p>\u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0443 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 PostgreSQL \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0435 \u043d\u044e\u0430\u043d\u0441\u044b. \u0412 \u0421\u0423\u0411\u0414 Oracle \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f <a href=\"https:\/\/www.oraexcel.com\/database-oracle-11gR2-ORA-24451\"><u>\u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438<\/u><\/a> &#8212; \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0430, \u0442\u043e Oracle \u0441\u0447\u0438\u0442\u0430\u0435\u0442, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u043b\u0441\u044f, \u0438 \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f. <a href=\"https:\/\/postgrespro.ru\/docs\/postgresql\/14\/queries-with#QUERIES-WITH-RECURSIVE\"><u>\u0412 \u0421\u0423\u0411\u0414 Postgres \u0434\u043e 14-\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u0442\u0430\u043a<\/u><\/a> &#8212; \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0433 \u0432\u043e\u0439\u0442\u0438 \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u043b\u0438 \u043a\u043e\u043f\u0438\u0442\u044c\u0441\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043e\u0447\u0438\u0449\u0430\u0432\u0448\u0438\u0435\u0441\u044f <\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-337618","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/337618","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=337618"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/337618\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=337618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=337618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=337618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}