{"id":305642,"date":"2020-06-19T21:00:38","date_gmt":"2020-06-19T21:00:38","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=305642"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=305642","title":{"rendered":"\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c \u0441\u0432\u043e\u0438\u043c\u0438 \u0440\u0443\u043a\u0430\u043c\u0438 \u0432 Postgresql"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/507430\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/img.freepik.com\/free-vector\/_24640-5611.jpg?size=338&amp;ext=jpg\" alt=\"image\" \/><\/div>\n<p>  \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0412\u0438\u043a\u0442\u043e\u0440 \u0438 \u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Gems Development. \u042f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f \u0432 Postgresql.<\/p>\n<p>  \u0420\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0438 \u043c\u0435\u0436\u0434\u0443\u043d\u0430\u0440\u043e\u0434\u043d\u044b\u0445 \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u043e\u0432. \u0412 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0434\u0430\u0442\u044b \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0434\u043d\u0435\u0439 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u0438\u0435 \u0443\u0441\u043b\u0443\u0433\u0438, \u043a\u0430\u043a \u00ab\u0412\u044b\u0434\u0430\u0447\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u00bb, \u00ab\u0412\u044b\u0434\u0430\u0447\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0432\u043e\u0434 \u0432 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u044e\u00bb \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u043e\u043a\u0438. <\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0432\u044b\u0432\u043e\u0434\u0443, \u0447\u0442\u043e \u0432 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0438 \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u0447\u043d\u044b\u0435 \u0434\u043d\u0438, \u0442.\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432 \u0438 \u043c\u043e\u0433\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435\u043c \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0433\u043e\u0434\u0443.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435\u043c:<\/p>\n<ul>\n<li>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0434\u043d\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043b\u0438 \u0434\u0430\u0442\u0430 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0438 \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u043e\u0432 \u0438\u043b\u0438 \u043d\u0435\u0442.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0434\u0435\u043d\u044c \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u043e\u043c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u0440\u0430\u0431\u043e\u0447\u0438\u043c, \u0442\u043e \u043e\u043d \u0442\u043e\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0434\u0435\u043d\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0447\u0438\u043c, \u0442\u043e, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0437 \u044d\u0442\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f.<\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0432 \u0441\u0435\u0441\u0441\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445:<\/p>\n<pre><code class=\"pgsql\">create schema calendar; set search_path=calendar; <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430:<\/p>\n<pre><code class=\"pgsql\">CREATE TABLE d_holidays (   holiday_date date,   comment character varying(1000),   CONSTRAINT d_holidays_pk PRIMARY KEY (holiday_date) ); <\/code><\/pre>\n<p>  \u0410 \u0442\u0430\u043a\u0436\u0435 \u0438\u043d\u0434\u0435\u043a\u0441, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043d\u0443\u0436\u043d\u043e\u0439 \u0434\u0430\u0442\u044b \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435:  <\/p>\n<pre><code class=\"pgsql\">CREATE UNIQUE INDEX d_holidays_pk_idx   ON d_holidays   USING btree   (holiday_date); <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u0437 Postgresql, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0443\u044e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0430, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445: \u0432\u0441\u0435 \u0434\u043d\u0438 \u0441 01.01.2017 \u043f\u043e 31.12.2025.<\/p>\n<pre><code class=\"pgsql\">insert into d_holidays(holiday_date) select generate_series(to_date('01.01.2017','dd.mm.yyyy'),             to_date('31.12.2025','dd.mm.yyyy'),             '1 day'); <\/code><\/pre>\n<p>  \u0423 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c 3287 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0434\u043d\u0435\u0439 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u0442. \u0412\u0430\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Postgresql \u0431\u044b\u043b \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u201cautovacuum = on\u201d. <\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043b\u0430\u043d \u0437\u0430\u043f\u0440\u043e\u0441\u0430:<\/p>\n<pre><code class=\"pgsql\">explain(analyze) select comment from d_holidays where holiday_date='09.09.2020'; <\/code><\/pre>\n<p>  \u041c\u044b \u0443\u0431\u0435\u0434\u0438\u043b\u0438\u0441\u044c, \u0447\u0442\u043e \u0438\u043d\u0434\u0435\u043a\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"pgsql\">Index Scan using d_holidays_pk on d_holidays  (cost=0.28..8.30 rows=1 width=516) (actual time=0.017..0.018 rows=1 loops=1)   Index Cond: (holiday_date = '2020-09-09'::date) Planning time: 0.083 ms Execution time: 0.044 ms <\/code><\/pre>\n<p>  \u0420\u0430\u0441\u0447\u0435\u0442 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0433\u043e\u0434\u0430. \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0432 \u0432\u0441\u0435 \u0434\u0430\u0442\u044b \u0441 1 \u044f\u043d\u0432\u0430\u0440\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u043e\u0434\u0430 \u043f\u043e 31 \u0434\u0435\u043a\u0430\u0431\u0440\u044f \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u043d\u0438 \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0438\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u043d\u044b\u0439 \u044f\u0437\u044b\u043a plpgsql \u0438 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0430\u043d\u043e\u043d\u0438\u043c\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430.<\/p>\n<p>  \u041f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u0442\u0443 \u043d\u0430 1 \u044f\u043d\u0432\u0430\u0440\u044f \u0438 \u043d\u0430 31 \u0434\u0435\u043a\u0430\u0431\u0440\u044f. <\/p>\n<pre><code class=\"pgsql\">do $$ declare     calc_year integer:=2020; --\u0423\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0433\u043e\u0434     begin_date date; --\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u0430\u0442\u044b \u0433\u043e\u0434\u0430     end_date date; --\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0434\u0430\u0442\u044b \u0433\u043e\u0434\u044b     dow integer; --\u043d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u043d\u0435\u0434\u0435\u043b\u0438. \u041f\u043d-1,...,\u0421\u0431-6,\u0412\u0441-0 begin     --\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0433\u043e\u0434\u0430 \u043d\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c     if calc_year between 1988 and 2099 then         begin_date :=to_date('01.01.'||calc_year, 'dd.mm.yyyy');         end_date :=to_date('31.12.'||calc_year, 'dd.mm.yyyy');     end if; end$$; <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0434\u043d\u044f \u043d\u0435\u0434\u0435\u043b\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 extract, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442 \u043d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u043d\u0435\u0434\u0435\u043b\u0438 (\u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435 \u2014 0). \u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043d\u044f \u043d\u0435\u0434\u0435\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e case.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442:<\/p>\n<pre><code class=\"pgsql\">do $$ declare     calc_year integer:=2020; --\u0423\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0433\u043e\u0434     begin_date date; --\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u0430\u0442\u044b \u0433\u043e\u0434\u0430     end_date date; --\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0434\u0430\u0442\u044b \u0433\u043e\u0434\u044b     dow_value integer; --\u043d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u043d\u0435\u0434\u0435\u043b\u0438. \u041f\u043d-1,...,\u0421\u0431-6,\u0412\u0441-0 begin     --\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0433\u043e\u0434\u0430 \u043d\u0430 \u043a\u043e\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c     if calc_year between 1988 and 2099 then         begin_date :=to_date('01.01.'||calc_year, 'dd.mm.yyyy');         end_date :=to_date('31.12.'||calc_year, 'dd.mm.yyyy');                  while begin_date&lt;=end_date         loop             raise info '%',to_char(begin_date,'dd.mm.yyyy');             begin_date:=begin_date+interval '1 day';             dow_value:=extract(dow from begin_date);             if dow_value in(0,6) then                 insert into d_holidays(holiday_date,comment)                         values(begin_date,                             case when dow_value=6 then '\u0421\u0443\u0431\u0431\u043e\u0442\u0430' else '\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435' end);             end if;         end loop;     end if; end$$; <\/code><\/pre>\n<p>  \u0420\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u0447\u043d\u044b\u0445 \u0434\u043d\u0435\u0439:<\/p>\n<pre><code class=\"pgsql\">insert into d_holidays(holiday_date,comment)      values(to_date('01.01.2020','dd.mm.yyyy'),'\u041d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u0438\u0435 \u043a\u0430\u043d\u0438\u043a\u0443\u043b\u044b')          on conflict(holiday_date) do update set comment=EXCLUDED.comment; \u2026         insert into d_holidays(holiday_date,comment)      values(to_date('04.05.2020','dd.mm.yyyy'),'\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0441 04.01.2020')          on conflict(holiday_date) do update set comment=EXCLUDED.comment; <\/code><\/pre>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0447\u0438\u043c \u0434\u043d\u0451\u043c. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 (\u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0431\u0440\u0430\u043d 2018 \u0433\u043e\u0434, \u0442.\u043a. \u0432 2020 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0431\u043e\u0447\u0438\u0435 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435):<\/p>\n<pre><code class=\"pgsql\">delete from d_holidays where holiday_date=to_date('29.12.2018','dd.mm.yyyy');  delete from d_holidays where holiday_date=to_date('09.06.2018','dd.mm.yyyy');  <\/code><\/pre>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"pgsql\">on conflict(holiday_date) do update set comment=EXCLUDED.comment; <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u043e\u0435 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 Postgresql 9.5 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u044b \u043f\u0440\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0435\u0441\u043b\u0438 \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a \u0443\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u043c, \u0442\u043e \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430 \u043f\u043e \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0443 \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0434\u0430\u0442\u043e\u0439 \u043c\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u0430\u0442\u044b, \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0434\u0443\u0431\u043b\u0438\u043a\u0430\u0442. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438: <\/p>\n<p>  \u0421\u043e\u0431\u0440\u0430\u0432 \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code class=\"pgsql\">do $$ declare     calc_year integer:=2020; --\u0423\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0433\u043e\u0434     begin_date date; --\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u0430\u0442\u044b \u0433\u043e\u0434\u0430     end_date date; --\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0434\u0430\u0442\u044b \u0433\u043e\u0434\u044b     dow_value integer; --\u043d\u043e\u043c\u0435\u0440 \u0434\u043d\u044f \u043d\u0435\u0434\u0435\u043b\u0438. \u041f\u043d-1,...,\u0421\u0431-6,\u0412\u0441-0 begin     --\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0433\u043e\u0434\u0430 \u043d\u0430 \u043a\u043e\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c     if calc_year between 1988 and 2099 then         begin_date :=to_date('01.01.'||calc_year, 'dd.mm.yyyy');         end_date :=to_date('31.12.'||calc_year, 'dd.mm.yyyy');                  while begin_date&lt;=end_date         loop             raise info '%',to_char(begin_date,'dd.mm.yyyy');             begin_date:=begin_date+interval '1 day';             dow_value:=extract(dow from begin_date);             if dow_value in(0,6) then                 insert into d_holidays(holiday_date,comment)                         values(begin_date,                             case when dow_value=6 then '\u0421\u0443\u0431\u0431\u043e\u0442\u0430' else '\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435' end);             end if;         end loop;         \/*\u0411\u043b\u043e\u043a \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u043e\u0432*\/         insert into d_holidays(holiday_date,comment)              values(to_date('01.01.2020','dd.mm.yyyy'),'\u041d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u0438\u0435 \u043a\u0430\u043d\u0438\u043a\u0443\u043b\u044b')              on conflict(holiday_date) do update set comment=EXCLUDED.comment;                      \/*\u041e\u043f\u0443\u0441\u0442\u0438\u043c \u0447\u0430\u0441\u0442\u044c Insert \u0434\u043b\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430*\/                      insert into d_holidays(holiday_date,comment)              values(to_date('05.11.2020','dd.mm.yyyy'),'\u0414\u0435\u043d\u044c \u043d\u0430\u0440\u043e\u0434\u043d\u043e\u0433\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0430')              on conflict(holiday_date) do update set comment=EXCLUDED.comment;                      insert into d_holidays(holiday_date,comment)              values(to_date('04.05.2020','dd.mm.yyyy'),'\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u0441 04.01.2020')              on conflict(holiday_date) do update set comment=EXCLUDED.comment;        \/*\u0411\u043b\u043e\u043a \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u043e\u0432 \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u043e\u0432*\/     end if; end$$; <\/code><\/pre>\n<p>  \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u043b\u043e\u0433\u0438\u043a\u0443 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0430 C#. \u0422\u0430\u043a\u0436\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0447\u0435\u0442\u044b \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f \u0432 Excel \u0438 LibreOffice.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/miro.medium.com\/max\/1104\/1*m1W1a6P9pcb3QfoDt3rRLQ.png\" alt=\"image\"\/><\/p>\n<p>  \u0413\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f \u0438 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0442\u0447\u0435\u0442 \u0432 Excel:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/miro.medium.com\/max\/552\/1*cBiwGIFKScX7YaJYEgiNlA.png\" alt=\"image\"\/><\/p>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0441 \u0447\u0435\u0433\u043e \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438 \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f \u0432 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043a\u0430\u043a\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438. \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0435\u0436\u0435\u0433\u043e\u0434\u043d\u043e\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u0447\u043d\u044b\u0445 \u0434\u043d\u044f\u0445. \u0422\u0435\u043c\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043c\u043e\u0439 \u043e\u043f\u044b\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u044b\u043b \u043f\u043e\u043b\u0435\u0437\u0435\u043d.<\/p>\n<p>  \u0410 \u043a\u0430\u043a \u0432\u044b \u0432\u0435\u0434\u0435\u0442\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044c?<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/507430\/\"> https:\/\/habr.com\/ru\/post\/507430\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/507430\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/img.freepik.com\/free-vector\/_24640-5611.jpg?size=338&amp;ext=jpg\" alt=\"image\" \/><\/div>\n<p>  \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u043c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0412\u0438\u043a\u0442\u043e\u0440 \u0438 \u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Gems Development. \u042f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u044f \u0432 Postgresql.<\/p>\n<p>  \u0420\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0433\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0438 \u043c\u0435\u0436\u0434\u0443\u043d\u0430\u0440\u043e\u0434\u043d\u044b\u0445 \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u043a\u043e\u0432. \u0412 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u0447\u0430\u0441\u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0434\u0430\u0442\u044b \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0434\u043d\u0435\u0439 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u0438\u0435 \u0443\u0441\u043b\u0443\u0433\u0438, \u043a\u0430\u043a \u00ab\u0412\u044b\u0434\u0430\u0447\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u00bb, \u00ab\u0412\u044b\u0434\u0430\u0447\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0432\u043e\u0434 \u0432 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u044e\u00bb \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0440\u043e\u043a\u0438. <\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0432\u044b\u0432\u043e\u0434\u0443, \u0447\u0442\u043e \u0432 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0438 \u043f\u0440\u0430\u0437\u0434\u043d\u0438\u0447\u043d\u044b\u0435 \u0434\u043d\u0438, \u0442.\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0435\u0442\u043e\u0432 \u0438 \u043c\u043e\u0433\u0443\u0442 \u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435\u043c \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0433\u043e\u0434\u0443.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-305642","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305642","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=305642"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/305642\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=305642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=305642"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=305642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}