Unix Technical Forum

default db

This is a discussion on default db within the Pgsql General forums, part of the PostgreSQL category; --> Hi, I see that the default encoding for a db is taken from template1. I'm using debian and I ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 05:22 PM
Sandro Dentella
 
Posts: n/a
Default default db

Hi,

I see that the default encoding for a db is taken from template1.

I'm using debian and I don't understand how to create template1 on
installation of postgresql with a preferred encoding.

Is it safe to just dump/restore template1 with different encoding?

TIA
*:-)


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 05:22 PM
Hannes Dorbath
 
Posts: n/a
Default Re: default db

On 22.05.2007 14:02, Sandro Dentella wrote:
> I see that the default encoding for a db is taken from template1.
>
> I'm using debian and I don't understand how to create template1 on
> installation of postgresql with a preferred encoding.
>
> Is it safe to just dump/restore template1 with different encoding?


Default encoding is taken from the cluster locale. Debian sure has some
fancy wrapper scripts for that, but

initdb -D $PGDATA --locale='en_US.utf8'

is the command to create a new cluster with another locale. Chose one
from locale -a


--
Regards,
Hannes Dorbath
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 05:22 PM
John D. Burger
 
Posts: n/a
Default Re: default db

Sandro Dentella wrote:

> I'm using debian and I don't understand how to create template1 on
> installation of postgresql with a preferred encoding.
>
> Is it safe to just dump/restore template1 with different encoding?


Or drop template1, and then recreate it from template0 with the
defaults you want. I gather that's the point of template0. See the
Fine Manual:

http://www.postgresql.org/docs/8.1/i...ive/manage-ag-
templatedbs.html

- John D. Burger
MITRE



---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:33 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com