Anvar Logo
01 / 01
Anvar Logo +91 808 999 0405

Postgres Use the same encoding as in the template database, or use template0 as template.

Postgres

Use the same encoding as in the template database, or use template0 as template this is the

root@server:~# su postgres
postgres@server:~ $ psql -U postgres
psql (9.0.3)
Type "help" for help.
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
template0=# drop database template1;
DROP DATABASE
template0=# create database template1 with template = template0 encoding = 'UTF8';
CREATE DATABASE
template0=# update pg_database set datistemplate = TRUE where datname = 'template1';
UPDATE 1
template0=# \c template1
You are now connected to database "template1".
template1=# update pg_database set datallowconn = FALSE where datname = 'template0';
UPDATE 1
template1=#
Ctrl+Z
postgres@server:~ $ exit
root@server:~#
by anvar
Published : Aug , 4
  1. Usually I do not learn post on blogs, however I would like to
    say that this write-up very compelled me to take a
    look at and do so! Your writing taste has been amazed me.
    Thank you, quite great post.

  2. When someone writes an article he/she retains the image of a user in his/her mind that
    how a user can be aware of it. Therefore that’s why this
    paragraph is perfect. Thanks!

Post a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.