TurnKey Linux Virtual Appliance Library

Postgresql default locale

Hi there,

I've just discovered Turnkey Linux and i've downloaded and install the postgresql appliance and all is well except one thing.

I've restored a database and although everything came over in one piece all the money fields are showing $ instead of £ signs (which is what I need).

Although the system locale is set to en_GB I can't set the postgres locale accordingly.

Is there any way around this that anyone knows of (short of using initdb to create a new cluster, which by the way I can't find the initdb program).

 

cheers in advance

 

paul

Liraz Siri's picture

According to PostgreSQL documentation you can't...

From http://www.postgresql.org/docs/7.4/static/charset.html:

"The nature of some locale categories is that their value has to be fixed for the lifetime of a database cluster. That is, once initdb has run, you cannot change them anymore. LC_COLLATE and LC_CTYPE are those categories. They affect the sort order of indexes, so they must be kept fixed, or indexes on text columns will become corrupt. PostgreSQL enforces this by recording the values of LC_COLLATE and LC_CTYPE that are seen by initdb. The server automatically adopts those two values when it is started."

Maybe try dumping, fiddling with the output and restoring to a new database?

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)