The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PostgreSQL encoding

Discussion in 'General Discussion' started by InSite, Oct 4, 2004.

  1. InSite

    InSite Member

    Joined:
    Oct 11, 2003
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Hi all,

    I'm having a problem with the encoding for PostgreSQL databases. When a postgre database is created in cPanel, it defaults to SQL_ASCII encoding, and I need to change this to EUC-JP for a particular database. None of the postgre users have any permissions to do this in phpPgAdmin.

    Does anyone have any ideas on how to change this? I have root access :)
     
  2. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    The one way is to drop that database and create it from command line like so.

    Code:
    su - postgres
    psql -Upostgres template1
    CREATE DATABASE cpuser_dbname WITH OWNER = cpuser TEMPLATE = template0 ENCODING = 'EUC-JP';
    \q
    
    DONE!

    Works a charm!

    cpuser = cpanel userid ;)
     
  3. InSite

    InSite Member

    Joined:
    Oct 11, 2003
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Thankyou very much - it looks like it's done the trick! Much appreciated :D
     
  4. IEka4ejbrw310t1

    IEka4ejbrw310t1 Registered

    Joined:
    Oct 27, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Just for completeness, provided you are granted the capability, this will also work:
    $ createdb -E encoding foo

    BUT the real question (or request for enhancement), is how to do this through cPanel. In my situation, databases can only be created via cPanel, and so it is not possible to choose (or change) the encoding.

    Any suggestions?
     
  5. luna

    luna Active Member

    Joined:
    Dec 27, 2003
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    How can I change the default encoding of Postgresql from SQL_ASCII to other encoding?
    There is some line in postgresql.conf, but modifing it does not work.

    Could someone help me? :confused:

    Thanks in advance!!
     
  6. nrm

    nrm Member
    PartnerNOC

    Joined:
    Jan 11, 2007
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Moscow, Russia
Loading...

Share This Page