Re: Fast default stuff versus pg_upgrade

From: Andres Freund <andres(at)anarazel(dot)de>
To: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Fast default stuff versus pg_upgrade
Date: 2018-06-21 01:04:14
Message-ID: 20180621010414.6gviy5hfyz2f3bub@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2018-06-20 20:53:34 -0400, Andrew Dunstan wrote:
> This version adds a lock on the table owning the attribute.

Cool.
>
> /*
> + * in binary upgrade mode, update the catalog with any missing values
> + * that might be present.
> + */
> + if (dopt->binary_upgrade)
> + {
> + for (j = 0; j < tbinfo->numatts; j++)
> + {
> + if (tbinfo->atthasmissing[j])
> + {
> + appendPQExpBufferStr(q, "\n-- set missing value.\n");
> + appendPQExpBufferStr(q,
> + "SELECT pg_catalog.binary_upgrade_set_missing_value(");
> + appendStringLiteralAH(q,qualrelname, fout);

missing space. Probably couldn't hurt to run the changed files through
pgindent and fix the damage...

> + appendPQExpBufferStr(q, "::pg_catalog.regclass,");
> + appendStringLiteralAH(q, tbinfo->attnames[j], fout);
> + appendPQExpBufferStr(q,",");

same.

> + appendStringLiteralAH(q, tbinfo->attmissingval[j], fout);
> + appendPQExpBufferStr(q,");\n\n");

same.

Looks reasonable to me, but I've not tested it.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2018-06-21 01:05:41 Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)
Previous Message Andrew Dunstan 2018-06-21 00:53:34 Re: Fast default stuff versus pg_upgrade