Criando BD utf-8 no PostgreSQL

Monday, 02. 14. 2011  –  Category: Banco de Dados, PostgreSQL, dicas

Para criar um Banco de Dados com codificacao UTF-8 no PostgreSQL, basta executar o Comando Abaixo:

postgres@server ~$ createdb E 'UTF-8' meudb

Se por acaso você recebeu uma mensagem como esta:

createdb: criação do banco de dados falhou: ERRO:  codificação UTF8 não corresponde a configuração regional pt_BR
DETALHE:  A definição de LC_TYPE escolhida requer codificação LATIN1.

Se a mensagem erro acima foi exibido, é necessário reconfigurar o Banco de Dados usando “initdb” para iniciar como “UNICODE”.

  1. Pare o serviço do Postgres:
    # /etc/init.d/postgresql stop
    
  2. Logado com o usuario “postgres”, crie um diretorio onde será armazenado os dados e configurações do Serviço e Bancos de Dadados:
    Logar com o usuário postgres

    # su - postgres

    Fazer o backup do diretorio principal:

    
    $ pgmain=/var/lib/postgresql/9.0/main
    $ mv -v $pgmain $pgmain".bkp"

    Criar um novo diretorio para substituir o antigo:

    $ mkdir $pgmain
    

    Rodar o initdb com as novas configurações:

    $ env LANG=en_US.UTF-8 /usr/lib/postgresql/9.0/bin/initdb --locale=en_US.UTF-8 --encoding=UNICODE -D $pgmain
    
    Observe o "env LANG=en_US.UTF-8" isto var definir o idioma local para "en_US.UTF-8", de forma que o initdb seja executado como o mesmo, permitindo assim a definição de UTF-8.

É isto aí pessoal, espero que tenha sido útil!

111 Responses to “Criando BD utf-8 no PostgreSQL”

  1. ANGEL Says:

    Order@Coral.Calcium.Online” rel=”nofollow”>..

    Buygeneric pills…

  2. SALVADOR Says:

    Cheap@Abilify.Online” rel=”nofollow”>..

    Buygeneric meds…

  3. DUSTIN Says:

    Cheap@Generic.Abilify” rel=”nofollow”>..

    Buygeneric drugs…

  4. EDUARDO Says:

    Cheap@Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>..

    Buygeneric pills…

  5. BRANDON Says:

    Buy@Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>..

    Buyno prescription…

  6. WALLACE Says:

    Purchase@Cheap.Acai” rel=”nofollow”>…

    Buygeneric drugs…

  7. SALVADOR Says:

    Cheap@Acai.Online” rel=”nofollow”>…

    Buynow…

  8. LEWIS Says:

    Purchase@Acai.Without.Prescription” rel=”nofollow”>..…

    Buynow it…

  9. ENRIQUE Says:

    Buy@Acai.500mg” rel=”nofollow”>.…

    Buynow it…

  10. JIMMIE Says:

    Buy@Discount.Coral.Calcium” rel=”nofollow”>..

    Buygeneric meds…

  11. PERRY Says:

    Buy@Generic.Abilify” rel=”nofollow”>…

    Buywithout prescription…

  12. BRADLEY Says:

    Order@Cheap.Coral.Calcium” rel=”nofollow”>.

    Buygeneric drugs…

  13. RALPH Says:

    Buy@Cheap.Acai” rel=”nofollow”>…

    Buygeneric drugs…

  14. SAMUEL Says:

    Buy@Cheap.Acai” rel=”nofollow”>…

    Buygeneric drugs…

  15. FELIX Says:

    Order@Acai.Online” rel=”nofollow”>…

    Buyit now…

  16. BRADLEY Says:

    Purchase@Generic.Acai” rel=”nofollow”>..

    Buygeneric drugs…

  17. ROLAND Says:

    Purchase@Acai.Without.Prescription” rel=”nofollow”>..…

    Buyno prescription…

  18. NATHAN Says:

    Order@Discount.Energy.Boost” rel=”nofollow”>.…

    Buynow it…

  19. ADAM Says:

    Buy@Discount.Accupril” rel=”nofollow”>.…

    Buyno prescription…

  20. LOUIS Says:

    Order@Cheap.Accupril” rel=”nofollow”>.…

    Buygeneric drugs…

  21. BRUCE Says:

    Order@Cheap.Accutane” rel=”nofollow”>.…

    Buygeneric drugs…

  22. ANDREW Says:

    Cheap@Aciphex.Without.Prescription” rel=”nofollow”>.…

    Buynow it…

  23. ALBERT Says:

    Cheap@Aciphex.20mg” rel=”nofollow”>.…

    Buygeneric meds…

  24. WILLIAM Says:

    Buy@Cheap.Acomplia” rel=”nofollow”>.…

    Buygeneric pills…

  25. RAY Says:

    Actonel@35mg.Without.Prescription” rel=”nofollow”>.

    Buygeneric drugs zfk…

  26. VICTOR Says:

    Get@Actoplus.Met.Online” rel=”nofollow”>..

    Buygeneric pills zdg…

  27. MARCUS Says:

    Order@Discount.Abana” rel=”nofollow”>..

    Buynow it vhx…

  28. LAWRENCE Says:

    Buy@Abilify.Online” rel=”nofollow”>..

    Buywithout prescription dyo…

  29. DARYL Says:

    Cheap@Abilify.Online” rel=”nofollow”>..

    Buygeneric drugs krg…

  30. MARION Says:

    Order@Cheap.Acai” rel=”nofollow”>..

    Buyno prescription gdt…

  31. ALLEN Says:

    Purchase@Acai.Without.Prescription” rel=”nofollow”>.

    Buyit now ojb…

  32. JOEL Says:

    Generic@Acai.500mg.Without.Prescription” rel=”nofollow”>..

    Buyno prescription wkp…

  33. JOHNNY Says:

    Buy@Cheap.Energy.Boost” rel=”nofollow”>…

    Buygeneric meds svb…

  34. AUSTIN Says:

    Order@Cheap.Accupril” rel=”nofollow”>.

    Buynow it fnp…

  35. LEROY Says:

    Order@Accutane.Online” rel=”nofollow”>…

    Buyit now sge…

  36. MARION Says:

    Order@Discount.Accutane” rel=”nofollow”>.

    Buygeneric drugs mby…

  37. JASON Says:

    Purchase@Cheap.Accutane” rel=”nofollow”>…

    Buywithout prescription ccw…

  38. RONALD Says:

    Buy@Aciphex.Online” rel=”nofollow”>.

    Buygeneric drugs itj…

  39. WENDELL Says:

    Cheap@Generic.Aciphex” rel=”nofollow”>..

    Buyno prescription lka…

  40. LEWIS Says:

    Order@Acomplia.Online” rel=”nofollow”>.

    Buygeneric drugs axm…

  41. BRUCE Says:

    Purchase@Acomplia.Online” rel=”nofollow”>..

    Buyno prescription jui…

  42. REGINALD Says:

    Order@Actonel.Without.Prescription” rel=”nofollow”>…

    Buydrugs without prescription jlg…

  43. GERARD Says:

    Order@Advair.Online” rel=”nofollow”>..

    Buyit now irl…

  44. EVAN Says:

    < a href="http://trig.com/advair5771/biography/?ml=Advair-25mcg/50mcg-25mcg/125mcg-25mcg/250mcg-50mcg/500mcg-50mcg/100mcg-50mcg/250mcg-Without-Prescription Advair@25mcg50mcg.25mcg125mcg.25mcg250mcg.50mcg500mcg.50mcg100mcg.50mcg250mcg.Without.Pr

    Buydrugs without prescription ygy…

  45. JON Says:

    Buy@Aggrenox.Online” rel=”nofollow”>..

    Buygeneric drugs ajd…

  46. JEFF Says:

    Purchase@Discount.Aggrenox” rel=”nofollow”>.

    Buynow it lmg…

  47. WENDELL Says:

    buy@acai.berry.juice” rel=”nofollow”>..

    Buygeneric drugs…

  48. BRYAN Says:

    accutane@krupnick.class.action” rel=”nofollow”>..

    Buynow…

  49. OLIVER Says:

    advair@copd.advertising.campaign” rel=”nofollow”>..

    Buynow…

  50. DAN Says:

    buy@amoxicillin.500mg” rel=”nofollow”>.

    Buynow it…

  51. ERIC Says:

    abilify@company.buy” rel=”nofollow”>.

    Buywithout prescription…

  52. BRENT Says:

    blue@sky.energy.solar.boost.3048” rel=”nofollow”>…

    Buynow it…

  53. RONNIE Says:

    amoxicillin@online.buy” rel=”nofollow”>.

    Buygeneric drugs…

  54. FERNANDO Says:

    arimidex@or.nolvadex.steriods” rel=”nofollow”>..

    Buywithout prescription…

  55. TREVOR Says:

    herpes kelly dating kansas

    Buy_no prescription…

  56. DUSTIN Says:

    strong insulin

    Buy_generic meds…

  57. RALPH Says:

    erectile dysfunction herbal treatment

    Buy_drugs without prescription…

  58. JESUS Says:

    brown algae good for slow thyroid

    Buy_generic drugs…

  59. LEON Says:

    steroids abuse sexual dysfunction

    Buy_it now…

  60. BILLY Says:

    hiv aids in california in 1997

    Buy_generic pills…

  61. FRANCIS Says:

    impact rating journal of clinical psychology

    Buy_now it…

  62. DALE Says:

    novo 50 allergy medicine

    Buy_now it…

  63. STUART Says:

    viagra in the uk

    Buy_no prescription…

  64. KENNETH Says:

    arimidex and marathon

    Buy_generic drugs…

  65. AUSTIN Says:

    lithium alcohol

    Buy_generic drugs…

  66. FREDERICK Says:

    good and bad drugs

    Buy_without prescription…

  67. HOWARD Says:

    is hepatitis b contagious

    Buy_generic pills…

  68. BILLY Says:

    drug rehab center british columbia

    Buy_generic drugs…

  69. KIRK Says:

    embed video webpage

    Buy_generic drugs…

  70. PEDRO Says:

    what is plavix

    Buy_drugs without prescription…

  71. DOUGLAS Says:

    postpartum remeron

    Buy_no prescription…

  72. CALVIN Says:

    medication errors 2nd ed

    Buy_no prescription…

  73. RENE Says:

    terbutaline autism claim

    Buy_no prescription…

  74. ANDREW Says:

    iv zofran

    Buy_drugs without prescription…

  75. MELVIN Says:

    oral cancer hospital

    Buy_generic meds…

  76. PATRICK Says:

    joke male birth control

    Buy_generic meds…

  77. FREDRICK Says:

    prozac daily strength

    Buy_generic pills…

  78. JOSHUA Says:

    chf vs pulmonary edema

    Buy_generic drugs…

  79. LOUIS Says:

    acne in cats

    Buy_it now…

  80. DUSTIN Says:

    weight loss tricks for 40 somethings

    Buy_drugs without prescription…

  81. WESLEY Says:

    nursing times alzheimer mavis ford

    Buy_it now…

  82. BILLY Says:

    diseaeses contracted from sand fleas

    Buy_now it…

  83. FRANCIS Says:

    pet ct scan results accuracy cancer

    Buy_drugs without prescription…

  84. NATHAN Says:

    pictures of herpes blisters

    Buy_generic pills…

  85. MARCUS Says:

    hypertension police ma

    Buy_drugs without prescription…

  86. WESLEY Says:

    reversing alcohol induced neuropathy

    Buy_generic meds…

  87. ALBERT Says:

    psychostimulant treatment of depression

    Buy_drugs without prescription…

  88. MITCHELL Says:

    natural cures for premature ejaculation

    Buy_generic drugs…

  89. CLINTON Says:

    copd lung sounds

    Buy_it now…

  90. BRENT Says:

    images of tongue cancer

    Buy_generic meds…

  91. CASEY Says:

    canadian paediatric diabetes association

    Buy_now…

  92. KEN Says:

    discovery of zinc in human health

    Buy_now…

  93. RUBEN Says:

    emotions surviveing uterine cancer

    Buy_generic meds…

  94. VERNON Says:

    azithromycin doxycycline over the counter

    Buy_generic pills…

  95. RICK Says:

    forensic drug test swab

    Buy_no prescription…

  96. LESLIE Says:

    clinical studies of clonidine

    Buy_no prescription…

  97. RYAN Says:

    diet generator reviews

    Buy_it now…

  98. ALEJANDRO Says:

    psychiatric care model

    Buy_generic meds…

  99. MARVIN Says:

    most successful diet ever

    Buy_generic pills…

  100. RUSSELL Says:

    dr loss phil ultimate weight

    Buy_no prescription…

  101. NATHANIEL Says:

    sleep apnea side effect of lexapro

    Buy_generic pills…

  102. JIM Says:

    indomethacin opthalmic drops

    Buy_generic pills…

  103. DAN Says:

    acute angle-closure glaucoma

    Buy_drugs without prescription…

  104. COREY Says:

    tobacco alternatives herbal

    Buy_generic drugs…

  105. RAMON Says:

    regulations for dementia units

    Buy_drugs without prescription…

  106. JOHNNIE Says:

    black molley slang drug name

    Buy_generic drugs…

  107. JACKIE Says:

    benadryl dogs

    Buy_generic drugs…

  108. ruth hill Says:

    short haircuts

    It is perfect time to make some plans for the future and it is time to be happy. I have read this post and if I could I want to suggest you few interesting things or advice. Perhaps you could write next articles referring to this article. I wish to rea…

  109. joyce allen Says:

    medium hairstyles

    I like the valuable info you provide in your articles. I’ll bookmark your blog and check again here frequently. I’m quite sure I will learn a lot of new stuff right here! Good luck for the next!…

  110. diana jenkins Says:

    haircuts

    Pretty nice post. I just stumbled upon your weblog and wanted to say that I’ve really enjoyed surfing around your blog posts. In any case I’ll be subscribing to your rss feed and I hope you write again soon!…

  111. laura hayes Says:

    short haircuts

    Excellent goods from you, man. I have understand your stuff previous to and you are just extremely fantastic. I actually like what you have acquired here, really like what you’re saying and the way in which you say it. You make it entertaining and you…

Leave a Reply