Your message dated Wed, 5 Nov 2014 10:17:24 +0100
with message-id <[email protected]>
and subject line Re: [Pkg-postgresql-public] Bug#768098: Upgrade Instructions - 
POSSIBLE DATA LOSS
has caused the Debian Bug report #768098,
regarding Upgrade Instructions - POSSIBLE DATA LOSS
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
768098: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=768098
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: postgresql

Version: 9.4~beta3-3

Severity: critical

 

The provided upgrade instructions, if run exactly, lead to data loss
(critical).

 

When following the provided instructions, the current working directory is
not changed.

Files are saved to the current working directory.

It is /extremely/ likely that the postgres user does not have write access
to said current working directory (often it is /root ).

 

The instructions should be modified to store and read files in ~ postgres/
OR include a cd ~postgres (to ensure that the correct directory is
referenced).

 

Alternatively, a multi-instruction pre/post commands with && separating
operations should be used, to force an error to occur the first time
revealing the need to modify the provided commands to administrator taste.

 

The provided example is particularly dangerous because it /looks/ at a
glance like it will work and that status messages might be ignorable (during
the work of copy/pasting or retyping lines).

 

 

 

 

Current, wrong, upgrade instructions.

 

The on-disk format of the PostgreSQL 9.4 data files has changed between

beta2 and beta3 (and as a consequence, the catalog version number). For that

reason, existing PostgreSQL 9.4 clusters need to be dumped using the old

package version, and reloaded after upgrading the packages.

 

The postgresql-9.4 package will now refuse to upgrade because version 9.4

clusters exist on the system.

 

Per default, a "main" cluster is created. Run "pg_lsclusters" to check if

other clusters exists, and repeat the steps below appropriately.

 

To resolve the situation, before upgrading, execute:

# su - postgres

$ pg_lsclusters

$ pg_ctlcluster 9.4 main start

$ pg_dumpall --cluster 9.4/main | gzip > 9.4-main.dump.gz

$ cp -a /etc/postgresql/9.4/main 9.4-main.config

$ pg_dropcluster 9.4 main --stop

 

Then after the upgrade, execute:

# su - postgres

$ pg_createcluster 9.4 main

$ cp 9.4-main.config/* /etc/postgresql/9.4/main

$ pg_ctlcluster 9.4 main start

$ zcat 9.4-main.dump.gz | psql -q

$ rm -rf 9.4-main.config 9.4-main.dump.gz

 


--- End Message ---
--- Begin Message ---
Re: Evgeni Golov 2014-11-05 <[email protected]>
> Hi Michael,
> 
> On 11/05/2014 12:11 AM, Michael Evans wrote:
> > The provided upgrade instructions, if run exactly, lead to data loss
> > (critical).
> 
> As there is no automatic upgrade, one could expect the admin reads the
> output on his screen. Otherwise dropcluster can produce data loss too :)
> 
> > When following the provided instructions, the current working directory
> > is not changed.
> 
> "su -" changes the working directory.

Exactly. I don't see a problem here.

> > The instructions should be modified to store and read files in ~
> > postgres/ OR include a cd ~postgres (to ensure that the correct
> > directory is referenced).
> 
> And what if there is not enough space left in ~postgres?

That case isn't really different from where there's not enough space
in / or /usr for upgrading any package. That's not a bug in the
package either.

If people don't read error messages we can't really help them. (And
"set -e" isn't a good idea in an interactive shell either.)

Christoph
-- 
[email protected] | http://www.df7cb.de/

--- End Message ---
_______________________________________________
Pkg-postgresql-public mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-postgresql-public

Reply via email to