[Pkg-postgresql-public] Bug#877920: postgresql-common: pg_upgradecluster 9.6 -> 10 fails (locale problem)

2017-10-07 Thread Christoph Berg
Re: Karsten Hilbert 2017-10-07 
<20171007154607.34udpgu2jxwsr...@hermes.hilbert.loc>
> >  chomp $ctype;
> >  chomp $collate;
> >  print STDERR "$ctype / $collate\n";
> >  return ($ctype, $collate);
> 
> Unfortunately not:
> 
>   root@hermes:~/bin# pg_upgradecluster 9.6 main
>   de_DE.UTF-8 / de_DE.UTF-8
>   0
>   Error: could not get cluster locales

This doesn't match the above code ("0"), did you edit the correct
file?

Christoph

___
Pkg-postgresql-public mailing list
Pkg-postgresql-public@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-postgresql-public


[Pkg-postgresql-public] Bug#877920: postgresql-common: pg_upgradecluster 9.6 -> 10 fails (locale problem)

2017-10-07 Thread Karsten Hilbert
On Sat, Oct 07, 2017 at 04:40:24PM +0200, Christoph Berg wrote:

> Can you check if the upgrade works properly if you remove the
> "unless"?
> 
>  chomp $ctype;
>  chomp $collate;
>  print STDERR "$ctype / $collate\n";
>  return ($ctype, $collate);

Unfortunately not:

root@hermes:~/bin# pg_upgradecluster 9.6 main
de_DE.UTF-8 / de_DE.UTF-8
0
Error: could not get cluster locales

Karsten
-- 
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

___
Pkg-postgresql-public mailing list
Pkg-postgresql-public@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-postgresql-public


[Pkg-postgresql-public] Bug#877920: postgresql-common: pg_upgradecluster 9.6 -> 10 fails (locale problem)

2017-10-07 Thread Karsten Hilbert
On Sat, Oct 07, 2017 at 05:34:15PM +0200, Christoph Berg wrote:

> Re: Karsten Hilbert 2017-10-07 
> <20171007152609.i4m5zc6yuol4j...@hermes.hilbert.loc>
 return ($ctype, $collate) unless $?;
> > 
> > Actually, isn't this inverted logic ?
> > 
> > It should return(...) unless $? actually is NOT zero ?
> 
> The extracted values should be returned if the last psql call exited
> with status 0. (Yes this function isn't the most pretty one. I'm
> inclined to rewrite the whole psql handling from scratch...)

I'll try to think it through although I am not a perl expert:

psql 

success

now $? is 0 (which is "FALSE")

return ($ctype, $collate) unless $?;

definition: statement unless condition

execute statement unless condition is true

condition: $? which is 0 which is "FALSE"

statement: "return" ($ctype, $collate)

hence: execute "return" unless "FALSE" is true

Won't work, right ?

It should be

return ($ctype, $collate) unless ($? != 0);

or am I mistaken ?

Karsten
-- 
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

___
Pkg-postgresql-public mailing list
Pkg-postgresql-public@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-postgresql-public


[Pkg-postgresql-public] Bug#877920: postgresql-common: pg_upgradecluster 9.6 -> 10 fails (locale problem)

2017-10-07 Thread Karsten Hilbert
On Sat, Oct 07, 2017 at 04:40:24PM +0200, Christoph Berg wrote:

> Re: Karsten Hilbert 2017-10-07 
> <20171007132123.7eqyzz7455f5x...@hermes.hilbert.loc>
> > root@hermes:/usr/share/perl5# pg_upgradecluster 9.6 main
> > de_DE.UTF-8 / de_DE.UTF-8
> > Error: could not get cluster locales
> 
> Hmm. At least the uninitialized value warning is gone now.

Yes, it does get one step further.

> > chomp $ctype;
> > chomp $collate;
> > print STDERR "$ctype / $collate\n";
> > return ($ctype, $collate) unless $?;
> 
> I wonder why $? is non-zero even if the $collate extraction worked.

Strangely enough:

chomp $ctype;
chomp $collate;
print STDERR "$ctype / $collate\n";
print STDERR "$?\n";
return ($ctype, $collate) unless $?;
return (undef, undef);

produces this:

root@hermes:~# pg_upgradecluster 9.6 main
de_DE.UTF-8 / de_DE.UTF-8
0
Error: could not get cluster locales

> Can you check if the upgrade works properly if you remove the "unless"?

Will do.

Karsten
-- 
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

___
Pkg-postgresql-public mailing list
Pkg-postgresql-public@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-postgresql-public


[Pkg-postgresql-public] Bug#877920: postgresql-common: pg_upgradecluster 9.6 -> 10 fails (locale problem)

2017-10-07 Thread Karsten Hilbert
Thanks for your response !

> could you provide the output of 'psql -l' for the old cluster?

Sure:

postgres@hermes:~$ psql -l
Ausgabeformat ist »wrapped«.
  Liste der Datenbanken
Name| Eigentümer | Kodierung | Sortierfolge | Zeichentyp  |  
Zugriffsprivilegien

++---+--+-+---
 akonadi| postgres   | UTF8  | de_DE.UTF-8  | de_DE.UTF-8 |
 gnumed_v20 | gm-dbo | UTF8  | de_DE.UTF-8  | de_DE.UTF-8 |
 gnumed_v21 | gm-dbo | UTF8  | de_DE.UTF-8  | de_DE.UTF-8 |
 gnumed_v22 | gm-dbo | UTF8  | de_DE.UTF-8  | de_DE.UTF-8 |
 orthanc_db | orthanc| UTF8  | de_DE.UTF-8  | de_DE.UTF-8 |
 postgres   | postgres   | UTF8  | de_DE.UTF-8  | de_DE.UTF-8 |
 template0  | postgres   | UTF8  | de_DE.UTF-8  | de_DE.UTF-8 | 
=c/postgres  +
||   |  | | 
postgres=CTc/postgres
 template1  | postgres   | UTF8  | de_DE.UTF-8  | de_DE.UTF-8 | 
postgres=CTc/postgres+
||   |  | | 
=c/postgres
(8 Zeilen)

> Also, please run
> 
>  SHOW lc_ctype;
>  SHOW lc_collate;
> 
> in the old cluster's template1 database.

postgres@hermes:~$ psql -d template1
Ausgabeformat ist »wrapped«.
psql (10.0, Server 9.6.5)
Geben Sie »help« für Hilfe ein.

template1=# show lc_ctype;
  lc_ctype
-
 de_DE.UTF-8
(1 Zeile)

template1=# show lc_collate;
 lc_collate
-
 de_DE.UTF-8
(1 Zeile)

HTH,
Karsten

___
Pkg-postgresql-public mailing list
Pkg-postgresql-public@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-postgresql-public


[Pkg-postgresql-public] Bug#877920: postgresql-common: pg_upgradecluster 9.6 -> 10 fails (locale problem)

2017-10-07 Thread Christoph Berg
Control: tags -1 moreinfo

Re: Karsten Hilbert 2017-10-07 
<150737030347.16226.787705667158988632.report...@hermes.hilbert.loc>
>   Use of uninitialized value $ctype in scalar chomp at 
> /usr/share/perl5/PgCommon.pm line 947.
>   Use of uninitialized value $collate in scalar chomp at 
> /usr/share/perl5/PgCommon.pm line 948.
>   Error: could not get cluster locales
>   root@hermes:~/bin#
> 
> Anything else I can provide ?

Hi,

could you provide the output of 'psql -l' for the old cluster?
Also, please run

 SHOW lc_ctype;
 SHOW lc_collate;

in the old cluster's template1 database.

Christoph

___
Pkg-postgresql-public mailing list
Pkg-postgresql-public@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-postgresql-public


[Pkg-postgresql-public] Bug#877920: postgresql-common: pg_upgradecluster 9.6 -> 10 fails (locale problem)

2017-10-07 Thread Karsten Hilbert
Package: postgresql-common
Version: 186
Severity: important

Hello,

when upgrading

Ver Cluster Port Status OwnerData directory   Log file
9.6 main5432 online postgres /var/lib/postgresql/9.6/main 
/var/log/postgresql/postgresql-9.6-main.log

like so:

root@hermes:~/bin# pg_upgradecluster 9.6 main

the following happens:

Use of uninitialized value $ctype in scalar chomp at 
/usr/share/perl5/PgCommon.pm line 947.
Use of uninitialized value $collate in scalar chomp at 
/usr/share/perl5/PgCommon.pm line 948.
Error: could not get cluster locales
root@hermes:~/bin#

Anything else I can provide ?

Karsten


-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'stable-updates'), (500, 'unstable'), 
(500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 4.13.0-trunk-686-pae (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), 
LANGUAGE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages postgresql-common depends on:
ii  adduser   3.116
ii  debconf   1.5.63
ii  init-system-helpers   1.49
ii  lsb-base  9.20170808
ii  postgresql-client-common  186
ii  procps2:3.3.12-3
ii  ssl-cert  1.0.39
ii  ucf   3.0036

Versions of packages postgresql-common recommends:
ii  logrotate  3.11.0-0.1

Versions of packages postgresql-common suggests:
ii  libjson-perl  2.94-1

-- Configuration Files:
/etc/postgresql-common/createcluster.conf changed:
initdb_options = '-k'
ssl = on
cluster_name = '%v/%c'
stats_temp_directory = '/var/run/postgresql/%v-%c.pg_stat_tmp'
log_line_prefix = '%%m [%%p] %%q%%u@%%d '
add_include_dir = 'conf.d'
include_dir '/etc/postgresql-common/createcluster.d'


-- debconf information:
  postgresql-common/catversion-bump:
  postgresql-common/ssl: true
* postgresql-common/obsolete-major:

___
Pkg-postgresql-public mailing list
Pkg-postgresql-public@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-postgresql-public