{"id":8946,"date":"2020-11-13T12:21:00","date_gmt":"2020-11-13T04:21:00","guid":{"rendered":"https:\/\/jpuyy.com\/?p=8946"},"modified":"2021-09-11T13:41:07","modified_gmt":"2021-09-11T05:41:07","slug":"postgresql","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=8946","title":{"rendered":"postgresql"},"content":{"rendered":"<p>postgresql service local<\/p>\n<p>https:\/\/hub.docker.com\/_\/postgres<\/p>\n<pre>\r\ndocker run --name postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres\r\ndocker exec -it postgres \/bin\/bash\r\n<\/pre>\n<p>test connection<\/p>\n<pre>\r\npg_isready -d <db_name> -h <host_name> -p <port_number> -U <db_user>\r\npg_isready -h 127.0.0.1 -p 5432 -U root\r\n<\/pre>\n<p>apt install postgresql-client-13<\/p>\n<p>find configuration file<\/p>\n<pre>\r\npsql -U postgres -c 'SHOW config_file'\r\n<\/pre>\n<p>print time<\/p>\n<pre>\r\npsql -U postgres -c \"select (to_char(CURRENT_TIMESTAMP ,'yyyy-MM-dd HH24:MI')||':00')::timestamp\"\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>postgresql service local https:\/\/hub.docker.com\/_\/postgres docker run &#8211;name postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres docker exec -it postgres \/bin\/bash test connection pg_isready -d -h -p -U pg_isready -h 127.0.0.1 -p 5432 -U root apt install postgresql-client-13 find configuration file psql -U postgres -c &#8216;SHOW config_file&#8217; print time psql -U postgres -c &#8220;select (to_char(CURRENT_TIMESTAMP ,&#8217;yyyy-MM-dd HH24:MI&#8217;)||&#8217;:00&#8242;)::timestamp&#8221;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[195],"tags":[],"class_list":["post-8946","post","type-post","status-publish","format-standard","hentry","category-postgresql"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/8946","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8946"}],"version-history":[{"count":7,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/8946\/revisions"}],"predecessor-version":[{"id":9377,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/8946\/revisions\/9377"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}