slevin
slevin

Reputation: 3888

how can i change the "character type" of a database in postgresql?

I'm using postgreSQL 9.1

I've set the Collation and the Character Type of the database to Greek_Greece.1253 and I want to change it to utf8

To change the collation I should use this, right?

But how can I change the character type?

Thanks

EDIT

I ment to wright C instead of utf8. I would like to change the Collation and the Character Type to C

Upvotes: 2

Views: 9993

Answers (1)

Ihor Romanchenko
Ihor Romanchenko

Reputation: 28511

You cannot change default collation of an existing database. You need to CREATE DATABASE with the collation you need and then dump/restore your schema and data into it.

If you do not want to recreate the database - you can specify collation for every text collumn in your db.

Here is detailed postgres manual on collations: Collation Support.

First line of this manual page states:

LC_COLLATE and LC_CTYPE settings of a database cannot be changed after its creation.

CREATE DATABASE, pg_dump, pg_restore

Upvotes: 2

Related Questions