Re: [GENERAL] pg_upgrade ?deficiency

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Andres Freund <andres(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Hilbert, Sebastian" <Sebastian(dot)Hilbert(at)gmx(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] pg_upgrade ?deficiency
Date: 2013-11-27 09:14:00
Message-ID: 20131127091400.GA5031@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Tue, Nov 26, 2013 at 03:25:44PM -0800, Kevin Grittner wrote:

> > doc patch?
>
> Instead of the fix you mean, or with it?  I don't see what we would
> change in the docs for the fix; the alternative might be to
> document that pg_dumpall output will fail to restore if any
> database (or the restoring user) has this property set.

a) since pg_dump is not planned to be changed to deal with
it a hint in the pg_dump docs would be helpful

I can fully understand the argument that if the dump
does NOT contain a "create database" the restore
should indeed honor the existing database setting.

In case it does contain a "create database" statement
the issue won't exist -- because the database will
need to be gone before the restore.

b) if pg_ugprade is not fixed then a hint in the docs
is useful (see below)

> > pg_upgrade probably needs a doc patch too, or a reset like
> > pg_dumpall.  pg_upgrade is more like pg_dumpall, so a code patch
> > seems most logical, again, assuming we decide that pg_dumpall is
> > the right place for this reset of default_transaction_read_only.
>
> I don't have much opinion on what the pg_upgrade aspect except,

The situation is this:

naive user:
- installs new PG version
- upgrades old cluster with one default_read_only database
- upgrade fails (or check fails - latter requires patch)
- user asks someone
- user unsets default_read_only
- upgrades old cluster
- upgrade succeeds
- user re-sets default_read_only

careful user:
- installs new PG version
- reads pg_upgrade docs of new version (requires doc patch)
- user unsets default_read_only
- upgrades old cluster
- upgrade succeeds
- user re-sets default_read_only

I can't for the life of it think of a scenario where
one would go: Oh, I've got a default_read_only
database -- let's NOT upgrade the cluster.

> check.  Passing the check but failing during the upgrade would not
> be very user-friendly.  Again, I'm not sure that a doc patch is
> needed to say that pg_upgrade works even when this option is set.
> Why would anyone assume otherwise?  Why would we list this property
> and not others?

A doc patch is only needed if pg_upgrade does NOT work
when some databases are default_read_only because THAT
is counterintuitive: To the naive user upgrading from
version to version is like "make a copy, perhaps rename
a file or two". It doesn't intuitively suggest a need
for WRITE access to individual databases themselves.

However, if the current behaviour is retained it would
be very useful to document that and also document one
or two ways around it (unsetting, PGOPTIONS, ...).

Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rémi Cura 2013-11-27 09:39:24 Re: tracking scripts...
Previous Message Albe Laurenz 2013-11-27 09:07:44 Re: tracking scripts...

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-11-27 09:15:10 Re: Incomplete freezing when truncating a relation during vacuum
Previous Message Peter Geoghegan 2013-11-27 09:09:49 Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE