{"id":796,"date":"2020-09-05T13:52:09","date_gmt":"2020-09-05T16:52:09","guid":{"rendered":"https:\/\/henriquereis.com\/blog\/?p=796"},"modified":"2020-09-05T15:26:35","modified_gmt":"2020-09-05T18:26:35","slug":"configuracoes-postgresql","status":"publish","type":"post","link":"https:\/\/henriquereis.com\/blog\/configuracoes-postgresql\/","title":{"rendered":"Configura\u00e7\u00f5es PostgreSQL"},"content":{"rendered":"\n<h2>Connectar<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo su - postgres<\/code> # entrar no usu\u00e1rio postgresl\npsql -d postgres -U postgres # conecta ao banco de dados postgres\ncreate database <strong>NOME-DO-BANCO<\/strong> # cria o banco de dados NOME-DO-BANCO;<\/pre>\n\n\n\n<h2>Criar schema<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">create schema <strong>NOME-DO-ESQUEMA<\/strong> to <strong>NOME-DO-BANCO<\/strong>;<\/pre>\n\n\n\n<h2>Criar usu\u00e1rio<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">CREATE USER <strong>NOME-DO-USUARIO<\/strong> WITH PASSWORD '<strong>SENHA<\/strong>';\ngrant all on database <strong>NOME-DO-BANCO<\/strong> to <strong>NOME-DO-USUARIO<\/strong>;<\/pre>\n\n\n\n<h2>Adicionar permiss\u00e3o para host<\/h2>\n\n\n\n<p>Abrir o arquivo \/etc\/postgresql\/VERSAO\/main\/pg_hdb.conf<\/p>\n\n\n\n<p>E adicionar:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">host all all <strong>network\/24<\/strong> password #\nPode ser usado \"password\", \"md5\" ou \"peer\"\n\nnetwork \u00e9 o ip da rede ou voc\u00ea pode colocar um IP do servidor que est\u00e1 rodando o PostgreSQL, sendo : IP\/32<\/pre>\n\n\n\n<p>Abrir o arquivo \/etc\/postgresql\/VERSAO\/main\/postgresql.conf<\/p>\n\n\n\n<p>E edite:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">listen_address = '<strong>localhost<\/strong>' # troque <strong>localhost<\/strong> pelo <strong>IP<\/strong> da interface que seja escutar.<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Connectar sudo su &#8211; postgres # entrar no usu\u00e1rio postgresl psql -d postgres -U postgres # conecta ao banco de dados postgres create database NOME-DO-BANCO # cria o banco de dados NOME-DO-BANCO; Criar schema create schema NOME-DO-ESQUEMA to NOME-DO-BANCO; Criar usu\u00e1rio CREATE USER NOME-DO-USUARIO WITH PASSWORD &#8216;SENHA&#8217;; grant all on database NOME-DO-BANCO to NOME-DO-USUARIO; Adicionar &hellip; <a href=\"https:\/\/henriquereis.com\/blog\/configuracoes-postgresql\/\" class=\"more-link\">Continue lendo <span class=\"screen-reader-text\">Configura\u00e7\u00f5es PostgreSQL<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/henriquereis.com\/blog\/wp-json\/wp\/v2\/posts\/796"}],"collection":[{"href":"https:\/\/henriquereis.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/henriquereis.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/henriquereis.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/henriquereis.com\/blog\/wp-json\/wp\/v2\/comments?post=796"}],"version-history":[{"count":3,"href":"https:\/\/henriquereis.com\/blog\/wp-json\/wp\/v2\/posts\/796\/revisions"}],"predecessor-version":[{"id":799,"href":"https:\/\/henriquereis.com\/blog\/wp-json\/wp\/v2\/posts\/796\/revisions\/799"}],"wp:attachment":[{"href":"https:\/\/henriquereis.com\/blog\/wp-json\/wp\/v2\/media?parent=796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/henriquereis.com\/blog\/wp-json\/wp\/v2\/categories?post=796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/henriquereis.com\/blog\/wp-json\/wp\/v2\/tags?post=796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}