Instalação do PostgreSQL no CentOS 7

Antes de fazer qualquer coisa, tenha certeza de que o sistema está atualizado:

# yum check-update
# yum

Agora, para instalar o PostgreSQL no CentOS 7, siga os passos abaixo.

1) Instalação do PostgreSQL:

Depois que o sistema estiver atualizado, como root, instale o PostgreSQL:

# yum install postgresql-server postgresql-pltcl postgresql-plpython postgresql-plperl postgresql-contrib postgresql-devel postgresql-docs postgresql postgresql-libs postgresql-odbc postgresql-upgrade

O comando acima instalará o servidor do PostgreSQL, as languages PL/TCL, PL/Phyton e PL/Perl, os pacotes adicionais do repositório contrib, as bibliotecas devel, a documentação, bibliotecas adicionais e o cliente de linha de comando. Obviamente você NÃO PRECISA instalar tudo isso, instale somente o que você realmente precisa.

Se quiser que uma instalação Apache/PHP instalada no mesmo host acesse o PostgreSQL, instale também o seguinte pacote:

# yum install php-pgsql

O PostgreSQL será instalado em /var/lib/pgsql e o usuário postgres será criado.

2) Inicialização do cluster do PostgreSQL:

Segure o teclado e NÃO INICIE o PostgreSQL ainda pois não geramos nenhum cluster de banco de dados ainda. Se você tentar iniciar o banco de dados receberá uma bela mensagem de erro.

No CentOS 7 existe um script que deve ser rodado como root para inicializar o cluster do PostgreSQL: /usr/bin/postgresql-setup.

A documentação do CentOS é um pouco falha sobre este script, pois não informa se é possível personalizar a inicialização sem alterar o script. Por segurança eu faço uma cópia desse script e modifico a linha específica de inicialização do cluster para alterar o locale e o encoding do cluster. Faça isso:

Altere a linha original, disso:

# Initialize the database
 initdbcmd="$PGENGINE/initdb --pgdata='$PGDATA' --auth='ident'"

Para isso:

# Initialize the database
initdbcmd="$PGENGINE/initdb --locale=C --encoding=utf8 --pgdata='$PGDATA' --auth='ident'"

Agora basta rodar o script, como root:

# postgresql-setup initdb

Agora você tem um cluster de banco de dados em /var/lib/pgsql/data e já pode iniciar o PostgreSQL. Faça isso, como root:

# systemctl enable postgresql.service
# systemctl start postgresql.service

Com os comandos acima você informou ao CentOS que é para iniciar o PostgreSQL durante o boot do sistema e iniciou imediatamente o banco de dados.

3) Outros ajustes no PostgreSQL:

Eu gosto de instalar outras “languages” no template de banco de dados para permitir que desenvolvedores utilizem essas languages para programar procedures, funções, etc. Como usuário postgres, faça isso:

# su - postgres
$ createlang plpgsql template1
$ createlang pltcl template1
$ createlang plperl template1
$ createlang plpythonu template1
$ createlang -l template1

Agora vamos alterar algumas configurações padronizadas para uso no Brasil. Edite o arquivo /var/lib/pgsql/data/postgresql.conf e modifique as seguintes variáveis para:

listen_addresses = 'localhost, <IP do host, se necessário>'

log_timezone = 'Brazil/East'

datestyle = 'iso, dmy'

timezone = 'Brazil/East'

lc_monetary = 'pt_BR.UTF-8'

lc_numeric = 'pt_BR.UTF-8'

lc_time = 'pt_BR.UTF-8'

default_text_search_config = 'pg_catalog.portuguese'

Agora crie uma senha para o usuário postgres acessar o banco de dados. Como usuário postgres, entre na linha de comando do PostgreSQL e crie uma senha (em vermelho está o que você deve digitar na linha de comando do psql):

$ psql
psql (9.2.13)
Type "help" for help.

postgres=# ALTER ROLE postgres
postgres-# ENCRYPTED PASSWORD '<senha>';
ALTER ROLE
postgres=# \q

$

Agora você precisa editar o arquivo de permissões de acesso do PostgreSQL e exigir uma senha para a conexão dos usuários. Edite o arquivo /var/lib/pgsql/data/pg_hba.conf e deixe as configurações do seguinte modo:

# "local" is for Unix domain socket connections only
local     all     all                      md5
#local    all     all                      peer

# IPv4 local connections:
host      all     all     127.0.0.1/32     ident

# IPv6 local connections:
host     all     all     ::1/128          ident

# Allow replication connections from localhost, by a user with the
# replication privilege.
#local    replication     postgres               peer
#host     replication     postgres  127.0.0.1/32 ident
#host     replication     postgres  ::1/128      ident

Para aplicar todas as alterações, reinicie o PostgreSQL, como root:

# systemctl restart postgresql.service

Para acessar o PostgreSQL, como usuário postgres, agora será obrigatório a senha:

# psql -U postgres
Password for user postgres: <digite a senha aqui>
psql (9.2.13)
Type "help" for help.

postgres=#

Outros ajustes podem ser feitos posteriormente, de acordo com suas necessidades.

1,040 thoughts on “Instalação do PostgreSQL no CentOS 7”

  1. Pingback: adam eve deal
  2. Pingback: aplus ucr
  3. Pingback: Brazilian Hair
  4. Pingback: porn movie
  5. Pingback: porn movie
  6. Pingback: musica cristiana
  7. Pingback: hackers for hire
  8. Pingback: prediksi bola
  9. Pingback: vibrator
  10. Pingback: wood grain paper
  11. Pingback: suterh
  12. Pingback: kona coffee
  13. Pingback: Afghanistan blog
  14. Pingback: dome tent price
  15. Pingback: Cloud Archiving
  16. Pingback: desktop software
  17. Pingback: kona coffee
  18. Pingback: lion kona coffee
  19. Pingback: rabbit vibrators
  20. Pingback: Kegel Kit
  21. Pingback: blow job
  22. Pingback: male stroker
  23. Pingback: website
  24. Pingback: adidas官方網
  25. Pingback: best finger vibe
  26. Pingback: کفسابی
  27. Pingback: Buy Vigra
  28. Pingback: colic calm
  29. Pingback: best web hosting
  30. Pingback: sex costume ideas
  31. Pingback: butt plug review
  32. Pingback: dong
  33. Pingback: vibrator realistic
  34. Pingback: the bunny vibrator
  35. Pingback: kona coffee
  36. Pingback: mini vibrator
  37. Pingback: digital marketing
  38. Pingback: stretch film
  39. Pingback: wild orchid
  40. Pingback: debit card
  41. Pingback: female sex toys
  42. Pingback: eva adult toy
  43. Pingback: adam n eve coupons
  44. Pingback: Sripatum
  45. Pingback: g spot sex toy
  46. Pingback: getting a dildo
  47. Pingback: RMUTT Thailand
  48. Pingback: sex whip
  49. Pingback: adam and eve
  50. Pingback: email processor
  51. Pingback: SEO specialist
  52. Pingback: Rip-Off
  53. Pingback: best anal beads
  54. Pingback: chiropractor
  55. Pingback: rubber dildo
  56. Pingback: love big dildo
  57. Pingback: travel watch
  58. Pingback: best big vibrator
  59. Pingback: long anal vibrator
  60. Pingback: peak vibrator
  61. Pingback: buy and sell
  62. Pingback: sex movie
  63. Pingback: how to make money
  64. Pingback: vacancy in haryana
  65. Pingback: anal plug
  66. Pingback: wand massagers
  67. Pingback: Orlando SEO
  68. Pingback: Apple
  69. Pingback: clit stimulator
  70. Pingback: خرید apple id
  71. Pingback: dildo realistic
  72. Pingback: کریو میکر
  73. Pingback: sexy doll
  74. Pingback: harmonica app
  75. Pingback: Twitter
  76. Pingback: rhalyns
  77. Pingback: anal desensitizing
  78. Pingback: Small vibrator
  79. Pingback: Less Of Tour
  80. Pingback: mp3 song
  81. Pingback: bunny sex toy
  82. Pingback: 卡巴熊
  83. Pingback: ways to make money
  84. Pingback: 美容外科
  85. Pingback: kona coffee beans
  86. Pingback: womens clothes
  87. Pingback: look here
  88. Pingback: This Site
  89. Pingback: nashville hotels
  90. Pingback: Hariyanvi Song
  91. Pingback: Old school R&B
  92. Pingback: sex video
  93. Pingback: اپل ایدی
  94. Pingback: خرید vpn
  95. Pingback: kona coffee beans
  96. Pingback: Kon coffee
  97. Pingback: خرید vpn
  98. Pingback: خرید vpn
  99. Pingback: Kona C 100%
  100. Pingback: هاست
  101. Pingback: persian tar
  102. Pingback: vegas tours
  103. Pingback: خرید vpn
  104. Pingback: best site
  105. Pingback: buy kona coffee
  106. Pingback: best coffee beans
  107. Pingback: خرید vpn
  108. Pingback: coffee maker
  109. Pingback: خرید kerio
  110. Pingback: خرید vpn
  111. Pingback: خرید کریو
  112. Pingback: view
  113. Pingback: خرید vpn
  114. Pingback: raman kathpalia
  115. Pingback: کریو خرید
  116. Pingback: خرید VPN
  117. Pingback: tam
  118. Pingback: خرید vpn
  119. Pingback: خرید vpn
  120. Pingback: Rbxtrading
  121. Pingback: triple stimulator
  122. Pingback: termeh
  123. Pingback: گوگل adwords
  124. Pingback: گوگل adwords
  125. Pingback: Belize city hotels
  126. Pingback: 脱毛
  127. Pingback: گوگل adwords
  128. Pingback: sportovní legíny
  129. Pingback: گوگل adwords
  130. Pingback: persian tar
  131. Pingback: free resume
  132. Pingback: گوگل adwords
  133. Pingback: داهوا
  134. Pingback: landing page
  135. Pingback: خرید vpn
  136. Pingback: خرید vpn
  137. Pingback: خرید vpn
  138. Pingback: سیستم cctv
  139. Pingback: سیستم cctv
  140. Pingback: zand game
  141. Pingback: خرید vpn
  142. Pingback: سیستم cctv
  143. Pingback: IPhone bulk
  144. Pingback: خرید طلا
  145. Pingback: خرید vpn
  146. Pingback: gratis inserieren
  147. Pingback: خرید vpn
  148. Pingback: massage prostate
  149. Pingback: سیستم cctv
  150. Pingback: خرید vpn
  151. Pingback: hp drivers
  152. Pingback: rotating dildo
  153. Pingback: خرید طلا
  154. Pingback: خرید vpn
  155. Pingback: vibrator review
  156. Pingback: testing bondage
  157. Pingback: towel
  158. Pingback: credit repair
  159. Pingback: خرید طلا
  160. Pingback: diet destinations
  161. Pingback: nipple clippers
  162. Pingback: sex while sick
  163. Pingback: monster dong
  164. Pingback: خرید vpn
  165. Pingback: خرید طلا
  166. Pingback: using dildo
  167. Pingback: Fülöp Henrik
  168. Pingback: penis pumps
  169. Pingback: سیستم cctv
  170. Pingback: Traveling
  171. Pingback: خرید vpn
  172. Pingback: vibrator
  173. Pingback: clit vibrator
  174. Pingback: squirting dildo
  175. Pingback: masturbation
  176. Pingback: خرید طلا
  177. Pingback: سیستم cctv
  178. Pingback: uber lube review
  179. Pingback: hydroquinone
  180. Pingback: Vibrator
  181. Pingback: brookline movers
  182. Pingback: Creation
  183. Pingback: biohealth protein
  184. Pingback: kona coffee beans
  185. Pingback: bahis siteleri
  186. Pingback: miniclip
  187. Pingback: bahis siteleri
  188. Pingback: bahis siteleri
  189. Pingback: bahis siteleri
  190. Pingback: horse racing
  191. Pingback: bahis siteleri
  192. Pingback: bahis siteleri
  193. Pingback: bahis siteleri
  194. Pingback: vibrator review
  195. Pingback: bahis siteleri
  196. Pingback: goldenbah's
  197. Pingback: Waterproof Jackets
  198. Pingback: orgasm girl
  199. Pingback: sex bondage
  200. Pingback: Morgellons Cure
  201. Pingback: clash royale hack
  202. Pingback: imoti
  203. Pingback: sex toy collection
  204. Pingback: G-Spot Vibrator
  205. Pingback: Benmjöl
  206. Pingback: strap on harness
  207. Pingback: solaray
  208. Pingback: how to use dildo
  209. Pingback: illuminati members
  210. Pingback: sex funiya
  211. Pingback: matka result
  212. Pingback: Compras Online
  213. Pingback: jageze
  214. Pingback: Free SEO Submitter
  215. Pingback: dental cosmetics
  216. Pingback: cash
  217. Pingback: love spell chant
  218. Pingback: cursos gratis
  219. Pingback: Tattoo Santiago
  220. Pingback: clean water
  221. Pingback: psychic
  222. Pingback: Instagram unfollow
  223. Pingback: psychic
  224. Pingback: African chats
  225. Pingback: mining schweiz
  226. Pingback: gps tracker
  227. Pingback: appunti
  228. Pingback: simulador ceneval
  229. Pingback: golf swing
  230. Pingback: prayer
  231. Pingback: brazilian hair
  232. Pingback: sex
  233. Pingback: remy hair
  234. Pingback: Indian hair
  235. Pingback: malaysian hair
  236. Pingback: peruvian hair
  237. Pingback: Apparel
  238. Pingback: xianxia novel
  239. Pingback: first time dildo
  240. Pingback: travel tips
  241. Pingback: prazdniki rossii
  242. Pingback: gastric
  243. Pingback: Cheap project app
  244. Pingback: univconstantine
  245. Pingback: mnogo seksa
  246. Pingback: sasha gray pussy
  247. Pingback: christian movies
  248. Pingback: Hydroquinone
  249. Pingback: sportotobet
  250. Pingback: Hydroquinone
  251. Pingback: pc build guide
  252. Pingback: Airbnb coupon
  253. Pingback: girl
  254. Pingback: clit vibrator
  255. Pingback: cheap
  256. Pingback: برش لیزر
  257. Pingback: Cialis vs viagra
  258. Pingback: Buy generic viagra
  259. Pingback: Cialis uk
  260. Pingback: Generic viagra
  261. Pingback: Buy generic cialis
  262. Pingback: Buy generic cialis
  263. Pingback: Discount viagra
  264. Pingback: threesome sex toys
  265. Pingback: SLICE DIAMOND
  266. Pingback: electronics
  267. Pingback: trah_net_621
  268. Pingback: sasha grey ur3
  269. Pingback: make money online
  270. Pingback: Butt Plug Review
  271. Pingback: ejaculating dildo
  272. Pingback: giant dildo
  273. Pingback: What Is Lol
  274. Pingback: kegel exercises
  275. Pingback: Trisha Paytas
  276. Pingback: anal play
  277. Pingback: erection pump
  278. Pingback: wand massager
  279. Pingback: Subscription Box
  280. Pingback: Glass Dildo
  281. Pingback: best sex toys
  282. Pingback: learn more here
  283. Pingback: adam and eve
  284. Pingback: pesni vse
  285. Pingback: sex toys for men
  286. Pingback: diamond vibrators
  287. Pingback: Sarah Rae Vargas
  288. Pingback: your gym workout
  289. Pingback: what is a strapon
  290. Pingback: soccer bet
  291. Pingback: 28 avgusta 9210
  292. Pingback: DraftKings DFS
  293. Pingback: Tire Pressure
  294. Pingback: friv
  295. Pingback: drivers
  296. Pingback: Lifestyle gadgets
  297. Pingback: Painters Brisbane
  298. Pingback: College Basketball
  299. Pingback: College Basketball
  300. Pingback: silicone rabbit
  301. Pingback: DraftKings NBA
  302. Pingback: سكس
  303. Pingback: quizhow
  304. Pingback: Sexycams
  305. Pingback: prazdnik segodnya
  306. Pingback: aflamsex
  307. Pingback: Curency conveter
  308. Pingback: german rottweiler
  309. Pingback: Live sexy cams
  310. Pingback: Funny videos
  311. Pingback: Sexlive
  312. Pingback: click to continue
  313. Pingback: Jumpstar car
  314. Pingback: Sex girls live
  315. Pingback: Freexxx
  316. Pingback: oral sex
  317. Pingback: Porn video
  318. Pingback: Sexy shemale
  319. Pingback: Hot babe
  320. Pingback: Iphone deal
  321. Pingback: lelo vibrator
  322. Pingback: Cheap iphone case
  323. Pingback: Iphone 7 case
  324. Pingback: nihal seneviratne
  325. Pingback: سكس
  326. Pingback: سكس مترجم
  327. Pingback: finger sex
  328. Pingback: the best vibrators
  329. Pingback: hitachi magic wand
  330. Pingback: butt plug review
  331. Pingback: Cialis 5 mg
  332. Pingback: سكس
  333. Pingback: Free MILF Porn
  334. Pingback: سكس مترجم
  335. Pingback: DFS
  336. Pingback: Dr Garo Kassabian
  337. Pingback: intel
  338. Pingback: nyc penthouse
  339. Pingback: AUTO AUCTION
  340. Pingback: prazdnik luny
  341. Pingback: facebook
  342. Pingback: lesbian vibrator
  343. Pingback: mp3 songs
  344. Pingback: Musicpleer
  345. Pingback: aflampornhd
  346. Pingback: read article
  347. Pingback: photo to sketch
  348. Pingback: more on the page
  349. Pingback: butterfly vibrator
  350. Pingback: link to details
  351. Pingback: follow the link
  352. Pingback: funny sex fails
  353. Pingback: tech house dj
  354. Pingback: Best Wand Massager
  355. Pingback: Best Anal Lube
  356. Pingback: nipple stimulator
  357. Pingback: silicone vibrator
  358. Pingback: poker 88
  359. Pingback: G Spot Vibe
  360. Pingback: screaming o vibe
  361. Pingback: real feel penis
  362. Pingback: sex toy tutorial
  363. Pingback: MILF Porn
  364. Pingback: mp3juices
  365. Pingback: tubidy
  366. Pingback: masturbation toys
  367. Pingback: huge dildo review
  368. Pingback: powerful vibrators
  369. Pingback: Buy cialis online
  370. Pingback: best bullet toy
  371. Pingback: writeaessay
  372. Pingback: Cialis coupon
  373. Pingback: g spot stimulation
  374. Pingback: Cialis 20mg
  375. Pingback: adam and eve sale
  376. Pingback: Generic cialis
  377. Pingback: knigi
  378. Pingback: اسکوتر
  379. Pingback: netflix free
  380. Pingback: iPhone 7 Charger
  381. Pingback: Lenovo
  382. Pingback: blow job tips
  383. Pingback: notehub.org
  384. Pingback: هپاش
  385. Pingback: follow this post
  386. Pingback: check this out
  387. Pingback: play online games
  388. Pingback: sex toy bar
  389. Pingback: notehub.org
  390. Pingback: notehub.org
  391. Pingback: click to see more
  392. Pingback: notehub.org
  393. Pingback: kakoy prazdnik
  394. Pingback: notehub.org source
  395. Pingback: notehub.org
  396. Pingback: free nintendo
  397. Pingback: amazon boston
  398. Pingback: Laptop sell
  399. Pingback: سئو سایت
  400. Pingback: Security Firm
  401. Pingback: rabbit sex toy
  402. Pingback: bullet sex toy
  403. Pingback: tongue vibrator
  404. Pingback: auto taxi
  405. Pingback: vibrating sex toys
  406. Pingback: Steuerberatung
  407. Pingback: علم غیب
  408. Pingback: interracial porn
  409. Pingback: pure kona coffee
  410. Pingback: malydomeczek
  411. Pingback: Knights Templar
  412. Pingback: rembacken
  413. Pingback: networkingbusiness
  414. Pingback: Best Magic Wand
  415. Pingback: Sex Swing Review
  416. Pingback: Anal Plug
  417. Pingback: stimulation gel
  418. Pingback: apple wholesale
  419. Pingback: notehub.org
  420. Pingback: notehub.org
  421. Pingback: notehub.org
  422. Pingback: notehub.org
  423. Pingback: page address
  424. Pingback: follow the link
  425. Pingback: Bondage Toys
  426. Pingback: Giant Dildo
  427. Pingback: notehub.org
  428. Pingback: notehub.org go
  429. Pingback: افلام سكس
  430. Pingback: mp3
  431. Pingback: notehub.org
  432. Pingback: review kingcock
  433. Pingback: dildo sex
  434. Pingback: free xlxx
  435. Pingback: vibrator
  436. Pingback: Hale Server
  437. Pingback: reasons dogs vomit
  438. Pingback: Pure kona coffee
  439. Pingback: fulton bail bond
  440. Pingback: 100% kona coffee
  441. Pingback: junk cars
  442. Pingback: buy lion coffee
  443. Pingback: lion kona coffee
  444. Pingback: lion coffee beans
  445. Pingback: dog clothes
  446. Pingback: Abraaj
  447. Pingback: electric bike
  448. Pingback: Instagram
  449. Pingback: hosting
  450. Pingback: Cbd
  451. Pingback: Clit Hummer Toy
  452. Pingback: adam and eve
  453. Pingback: ninebot
  454. Pingback: phenq
  455. Pingback: iptv admin panel
  456. Pingback: what is a barrage
  457. Pingback: seo service
  458. Pingback: Vanessa Lunnon
  459. Pingback: IT Support
  460. Pingback: free phone cases
  461. Pingback: Gary Kurtz

Leave a Reply