Opened 6 years ago

Closed 6 years ago

#1279 closed defect (fixed)

PostgreSQL 9.3 template encoding

Reported by: kalxas Owned by: live-demo@…
Priority: blocker Milestone: OSGeoLive7.9
Component: OSGeoLive Keywords:
Cc: live-demo@…

Description

Removing obsolete dictionary files:
 * No PostgreSQL clusters exist; see "man pg_createcluster"
Setting up postgresql-9.3 (9.3.2-1.pgdg12.4+1~precise) ...
Creating new cluster 9.3/main ...
  config /etc/postgresql/9.3/main
  data   /var/lib/postgresql/9.3/main
  locale C
  port   5432
update-alternatives: using /usr/share/postgresql/9.3/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode.
 * Starting PostgreSQL 9.3 database server
   ...done.

and then:

Processing triggers for menu ...
ALTER ROLE
createdb: database creation failed: ERROR:  new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT:  Use the same encoding as in the template database, or use template0 as template.
psql: FATAL:  database "user" does not exist

Change history (8)

comment:1 Changed 6 years ago by darkblueb

I have installed a fresh XUbuntu 12.04.3 to VM and run setup.sh by hand; saved a snapshot.

The first time through, installing pieces of postgis and data by hand, I had a crash, after ls and whoami were 'not found' and cd failed to permission denied. Attempt to shutdown hung.

The next time, PostGIS + load_gisdata completed, with correct UTF-8 encoding.. However, booting from an a3 .iso, I see this:

                                                                  List of databases
       Name       |  Owner   | Encoding  | Collate | Ctype |   Access privileges   |  Size   | Tablespace |                Description                 
------------------+----------+-----------+---------+-------+-----------------------+---------+------------+--------------------------------------------
 52nSOS           | postgres | SQL_ASCII | C       | C     | =Tc/postgres         +| 25 MB   | pg_default | 
                  |          |           |         |       | postgres=CTc/postgres+|         |            | 
                  |          |           |         |       | user=CTc/postgres     |         |            | 
 RASBASE          | root     | SQL_ASCII | C       | C     |                       | 6250 kB | pg_default | 
 cartaro          | cartaro  | UTF8      | C       | C     |                       | 20 MB   | pg_default | 
 eoxserver_demo   | user     | SQL_ASCII | C       | C     |                       | 15 MB   | pg_default | 
 mapbender3.0.0.2 | user     | SQL_ASCII | C       | C     |                       | 8498 kB | pg_default | 
 natural_earth2   | user     | SQL_ASCII | C       | C     |                       | 78 MB   | pg_default | 
 osm_local        | user     | SQL_ASCII | C       | C     |                       | 44 MB   | pg_default | 
 petascopedb      | root     | SQL_ASCII | C       | C     |                       | 6250 kB | pg_default | 
 postgres         | postgres | SQL_ASCII | C       | C     |                       | 6106 kB | pg_default | default administrative connection database
 template0        | postgres | SQL_ASCII | C       | C     | =c/postgres          +| 6009 kB | pg_default | unmodifiable empty database
                  |          |           |         |       | postgres=CTc/postgres |         |            | 
 template1        | postgres | SQL_ASCII | C       | C     | =c/postgres          +| 6106 kB | pg_default | default template for new databases
                  |          |           |         |       | postgres=CTc/postgres |         |            | 

Why ? not yet known

comment:2 Changed 6 years ago by darkblueb

using base_stable_01 snapshot and running install_postgis.sh + load_gisdata.sh :

user@live-rc1:~$ cat /tmp/all_tables.txt 
                                                                         List of databases
        Name        |  Owner   | Encoding |   Collate   |    Ctype    |    Access privileges    |  Size   | Tablespace |                Description                 
--------------------+----------+----------+-------------+-------------+-------------------------+---------+------------+--------------------------------------------
 52nSOS             | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres           +| 24 MB   | pg_default | 
                    |          |          |             |             | postgres=CTc/postgres  +|         |            | 
                    |          |          |             |             | user=CTc/postgres       |         |            | 
 RASBASE            | root     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                         | 67 MB   | pg_default | 
 cartaro            | cartaro  | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                         | 20 MB   | pg_default | 
 eoxserver_demo     | user     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                         | 15 MB   | pg_default | 
 geonode            | user     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                         | 15 MB   | pg_default | 
 mapbender3.0.0.2   | user     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                         | 8097 kB | pg_default | 
 natural_earth2     | user     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                         | 82 MB   | pg_default | 
 osm_local          | user     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                         | 37 MB   | pg_default | 
 petascopedb        | root     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                         | 7673 kB | pg_default | 
 pgrouting          | user     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                         | 30 MB   | pg_default | 
 postgres           | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                         | 5754 kB | pg_default | default administrative connection database
 sahana             | sahana   | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                         | 30 MB   | pg_default | 
 template0          | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres            +| 5665 kB | pg_default | unmodifiable empty database
                    |          |          |             |             | postgres=CTc/postgres   |         |            | 
 template1          | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres            +| 5665 kB | pg_default | default template for new databases
                    |          |          |             |             | postgres=CTc/postgres   |         |            | 
 uf_basegrid_bamin  | user     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                         | 1968 MB | pg_default | 
 user               | user     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                         | 5890 kB | pg_default | 
 v2.2_mapfishsample | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres           +| 10 MB   | pg_default | 
                    |          |          |             |             | postgres=CTc/postgres  +|         |            | 
                    |          |          |             |             | "www-data"=CTc/postgres |         |            | 
(17 rows)

comment:3 Changed 6 years ago by darkblueb

no - wrong VM.. (that is 7.0) this is the one (similar)

      Name      |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   |  Size   | Tablespace |                Description                 
----------------+----------+----------+-------------+-------------+-----------------------+---------+------------+--------------------------------------------
 natural_earth2 | user     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 83 MB   | pg_default | 
 postgres       | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 6074 kB | pg_default | default administrative connection database
 template0      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +| 5977 kB | pg_default | unmodifiable empty database
                |          |          |             |             | postgres=CTc/postgres |         |            | 
 template1      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +| 5977 kB | pg_default | default template for new databases
                |          |          |             |             | postgres=CTc/postgres |         |            | 
 user           | user     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 6194 kB | pg_default | 
(5 rows)


comment:4 Changed 6 years ago by kalxas

Setting up postgresql-client-common (151.pgdg12.4+1~precise2) ...
Setting up postgresql-client-9.3 (9.3.2-1.pgdg12.4+1~precise) ...
update-alternatives: using /usr/share/postgresql/9.3/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode.
Setting up postgresql-common (151.pgdg12.4+1~precise2) ...
Adding user postgres to group ssl-cert
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
  en_us
Removing obsolete dictionary files:
 * No PostgreSQL clusters exist; see "man pg_createcluster"
Setting up postgresql-9.3 (9.3.2-1.pgdg12.4+1~precise) ...
Creating new cluster 9.3/main ...
  config /etc/postgresql/9.3/main
  data   /var/lib/postgresql/9.3/main
  locale C
  port   5432
update-alternatives: using /usr/share/postgresql/9.3/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode.
 * Starting PostgreSQL 9.3 database server
   ...done.

so the cluster installation in the deb package initiallizes a non UTF-8 cluster

comment:5 Changed 6 years ago by darkblueb

note: built-in supported debian/ubuntu locales are at least:

bg_BG, bs_BA.ISO8859-2, ca_ES@euro, cs_CZ, da_DK, 
de_BE@euro, de_CH, de_DE@euro, el_GR.UTF-8, 
en_AU, en_CA, en_GB, en_IE@euro, en_US, 
es_AR, es_ES@euro, es_MX, es_PE, fa_IR.UTF-8, 
fi_FI, fi_FI@euro, 
fr_BE, fr_BE@euro, fr_CA, fr_CH, fr_FR@euro, 
ga_IE@euro, gd_GB, gv_GB, he_IL, it_IT@euro, 
ja_JP.EUC-JP, ko_KR, kw_GB, lt_LT, lv_LV, nb_NO, nds_DE, 
nl_BE@euro, nl_NL@euro, nn_NO, no_NO, 
pl_PL, pt_BR, ru_RU, se_NO, sk_SK, sl_SI, 
sv_FI, sv_FI@euro, sv_SE, 
tr_TR, uk_UA

comment:7 Changed 6 years ago by kalxas

Confirmed that Postgresql encoding is UTF-8 in this build. Original error gone.

comment:8 Changed 6 years ago by kalxas

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.