character encoding of the postgres database

Started by Sandeep Guptaalmost 9 years ago4 messagesgeneral
Jump to latest
#1Sandeep Gupta
gupta.sandeep@gmail.com

Currently, the postgres database by has SQL_ASCII encoding.

psql -p 5771 postgres -l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+---------+-----------+---------+-------+---------------------
postgres | sandeep | SQL_ASCII | C | C |
template0 | sandeep | SQL_ASCII | C | C | =c/sandeep +
| | | | | sandeep=CTc/sandeep
template1 | sandeep | SQL_ASCII | C | C | =c/sandeep +
| | | | | sandeep=CTc/sandeep
(3 rows)

Is it possible to start the postgres database with UTF-8 encoding, instead
of modifying it later.

Thanks
sandeep

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Sandeep Gupta (#1)
Re: character encoding of the postgres database

On 5/10/17 11:48, Sandeep Gupta wrote:

Currently, the postgres database by has SQL_ASCII encoding.

Is it possible to start the postgres database with UTF-8 encoding, instead
of modifying it later.

This is done when initdb is run, with the --locale and/or --encoding option.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Sandeep Gupta (#1)
Re: character encoding of the postgres database

On 05/10/2017 08:48 AM, Sandeep Gupta wrote:

Currently, the postgres database by has SQL_ASCII encoding.

psql -p 5771 postgres -l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+---------+-----------+---------+-------+---------------------
postgres | sandeep | SQL_ASCII | C | C |
template0 | sandeep | SQL_ASCII | C | C | =c/sandeep +
| | | | | sandeep=CTc/sandeep
template1 | sandeep | SQL_ASCII | C | C | =c/sandeep +
| | | | | sandeep=CTc/sandeep
(3 rows)

Is it possible to start the postgres database with UTF-8 encoding, instead
of modifying it later.

See Peter's post, just remember that SQL_ASCII is essentially no
encoding so be prepared for issues. I would test before doing this on
live data.

Thanks
sandeep

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Sandeep Gupta
gupta.sandeep@gmail.com
In reply to: Adrian Klaver (#3)
Re: character encoding of the postgres database

Thank you.

On Wed, May 10, 2017 at 12:54 PM, Adrian Klaver
<adrian.klaver@aklaver.com> wrote:

On 05/10/2017 08:48 AM, Sandeep Gupta wrote:

Currently, the postgres database by has SQL_ASCII encoding.

psql -p 5771 postgres -l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+---------+-----------+---------+-------+---------------------
postgres | sandeep | SQL_ASCII | C | C |
template0 | sandeep | SQL_ASCII | C | C | =c/sandeep +
| | | | | sandeep=CTc/sandeep
template1 | sandeep | SQL_ASCII | C | C | =c/sandeep +
| | | | | sandeep=CTc/sandeep
(3 rows)

Is it possible to start the postgres database with UTF-8 encoding, instead
of modifying it later.

See Peter's post, just remember that SQL_ASCII is essentially no encoding so
be prepared for issues. I would test before doing this on live data.

Thanks
sandeep

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general