postgres/src
Stephen Frost ff992c074e pg_upgrade: Fix large object COMMENTS, SECURITY LABELS
When performing a pg_upgrade, we copy the files behind pg_largeobject
and pg_largeobject_metadata, allowing us to avoid having to dump out and
reload the actual data for large objects and their ACLs.

Unfortunately, that isn't all of the information which can be associated
with large objects.  Currently, we also support COMMENTs and SECURITY
LABELs with large objects and these were being silently dropped during a
pg_upgrade as pg_dump would skip everything having to do with a large
object and pg_upgrade only copied the tables mentioned to the new
cluster.

As the file copies happen after the catalog dump and reload, we can't
simply include the COMMENTs and SECURITY LABELs in pg_dump's binary-mode
output but we also have to include the actual large object definition as
well.  With the definition, comments, and security labels in the pg_dump
output and the file copies performed by pg_upgrade, all of the data and
metadata associated with large objects is able to be successfully pulled
forward across a pg_upgrade.

In 9.6 and master, we can simply adjust the dump bitmask to indicate
which components we don't want.  In 9.5 and earlier, we have to put
explciit checks in in dumpBlob() and dumpBlobs() to not include the ACL
or the data when in binary-upgrade mode.

Adjustments made to the privileges regression test to allow another test
(large_object.sql) to be added which explicitly leaves a large object
with a comment in place to provide coverage of that case with
pg_upgrade.

Back-patch to all supported branches.

Discussion: https://postgr.es/m/20170221162655.GE9812@tamriel.snowman.net
2017-03-06 17:03:57 -05:00
..
backend Avoid dangling pointer to relation name in RLS code path in DoCopy(). 2017-03-06 16:50:47 -05:00
bin pg_upgrade: Fix large object COMMENTS, SECURITY LABELS 2017-03-06 17:03:57 -05:00
common Remove useless duplicate inclusions of system header files. 2017-02-25 16:12:55 -05:00
fe_utils Remove useless duplicate inclusions of system header files. 2017-02-25 16:12:55 -05:00
include Replace LookupFuncNameTypeNames() with LookupFuncWithArgs() 2017-03-06 13:31:47 -05:00
interfaces Remove useless duplicate inclusions of system header files. 2017-02-25 16:12:55 -05:00
makefiles Try to fix non-MSVC Windows builds in the wake of logical replication. 2017-01-20 12:51:31 -05:00
pl Remove PL/Tcl's "module" facility. 2017-02-27 11:20:22 -05:00
port Put back #include <windows.h> in dirmod.c. 2017-02-25 18:34:09 -05:00
template Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
test pg_upgrade: Fix large object COMMENTS, SECURITY LABELS 2017-03-06 17:03:57 -05:00
timezone Remove useless duplicate inclusions of system header files. 2017-02-25 16:12:55 -05:00
tools Add operator_with_argtypes grammar rule 2017-03-06 13:31:47 -05:00
tutorial Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
.gitignore
bcc32.mak
DEVELOPERS
Makefile Remove redundant coverage target 2017-02-17 08:56:57 -05:00
Makefile.global.in Dept of second thoughts: rename new perl script. 2017-02-19 16:41:51 -05:00
Makefile.shlib Fix typos in comments. 2017-02-06 11:33:58 +02:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak