postgresql/src/include
Tom Lane 1a2c17f8e2 Fix pg_upgrade to not fail when new-cluster TOAST rules differ from old.
This patch essentially reverts commit 4c6780fd17, in favor of a much
simpler solution for the case where the new cluster would choose to create
a TOAST table but the old cluster doesn't have one: just don't create a
TOAST table.

The existing code failed in at least two different ways if the situation
arose: (1) ALTER TABLE RESET didn't grab an exclusive lock, so that the
lock sanity check in create_toast_table failed; (2) pg_upgrade did not
provide a pg_type OID for the new toast table, so that the crosscheck in
TypeCreate failed.  While both these problems were introduced by later
patches, they show that the hack being used to cause TOAST table creation
is overwhelmingly fragile (and untested).  I also note that before the
TypeCreate crosscheck was added, the code would have resulted in assigning
an indeterminate pg_type OID to the toast table, possibly causing a later
OID conflict in that catalog; so that it didn't really work even when
committed.

If we simply don't create a TOAST table, there will only be a problem if
the code tries to store a tuple that's wider than a page, and field
compression isn't sufficient to get it under a page.  Given that the TOAST
creation threshold is intended to be about a quarter of a page, it's very
hard to believe that cross-version differences in the do-we-need-a-toast-
table heuristic could result in an observable problem.  So let's just
follow the old version's conclusion about whether a TOAST table is needed.

(If we ever do change needs_toast_table() so much that this conclusion
doesn't apply, we can devise a solution at that time, and hopefully do
it in a less klugy way than 4c6780fd17 did.)

Back-patch to 9.3, like the previous patch.

Discussion: <8110.1462291671@sss.pgh.pa.us>
2016-05-06 22:05:56 -04:00
..
access Revert timeline following in replication slots 2016-05-04 17:32:22 -03:00
bootstrap Update copyright for 2016 2016-01-02 13:33:40 -05:00
catalog Fix pg_upgrade to not fail when new-cluster TOAST rules differ from old. 2016-05-06 22:05:56 -04:00
commands Support ALTER THING .. DEPENDS ON EXTENSION 2016-04-05 18:38:54 -03:00
common Avoid PGDLLIMPORT for simple local references in frontend programs. 2016-03-23 23:26:44 -04:00
datatype Be more careful about out-of-range dates and timestamps. 2016-03-16 19:09:28 -04:00
executor Rework custom scans to work more like the new extensible node stuff. 2016-03-29 11:28:04 -04:00
fe_utils Move and rename fmtReloptionsArray(). 2016-05-06 12:45:36 +01:00
foreign Don't require a user mapping for FDWs to work. 2016-03-28 21:50:28 -04:00
lib Remove mergeHyperLogLog. 2016-04-27 10:55:32 -04:00
libpq Add authentication parameters compat_realm and upn_usename for SSPI 2016-04-08 20:28:38 +02:00
mb Update copyright for 2016 2016-01-02 13:33:40 -05:00
nodes Fix EXPLAIN VERBOSE output for parallel aggregate. 2016-04-27 07:37:40 -04:00
optimizer Fix mishandling of equivalence-class tests in parameterized plans. 2016-04-29 20:19:38 -04:00
parser Support ALTER THING .. DEPENDS ON EXTENSION 2016-04-05 18:38:54 -03:00
port Fix comment whitespace in VS2105 patch 2016-04-29 14:18:51 -04:00
portability Update copyright for 2016 2016-01-02 13:33:40 -05:00
postmaster Allow Pin/UnpinBuffer to operate in a lockfree manner. 2016-04-10 20:12:32 -07:00
regex Suppress compiler warnings about useless comparison of unsigned to zero. 2016-02-15 17:12:16 -05:00
replication Fix thinko in comment 2016-05-02 16:46:42 -03:00
rewrite Update copyright for 2016 2016-01-02 13:33:40 -05:00
snowball Update copyright for 2016 2016-01-02 13:33:40 -05:00
storage Fix typo 2016-04-29 16:15:07 +02:00
tcop Widen query numbers-of-tuples-processed counters to uint64. 2016-03-12 16:05:29 -05:00
tsearch Restore original tsquery operation numbering. 2016-04-08 20:11:30 +03:00
utils Fix hash index vs "snapshot too old" problemms 2016-05-06 07:47:12 -05:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
c.h Make init_spin_delay() C89 compliant and change stuck spinlock reporting. 2016-04-13 17:00:53 -07:00
fmgr.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
funcapi.h Widen query numbers-of-tuples-processed counters to uint64. 2016-03-12 16:05:29 -05:00
getaddrinfo.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
getopt_long.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
Makefile Create src/fe_utils/, and move stuff into there from pg_dump's dumputils. 2016-03-24 15:55:57 -04:00
miscadmin.h Use quicksort, not replacement selection, for external sorting. 2016-04-08 02:36:26 -04:00
pg_config.h.in Add BSD authentication method. 2016-04-08 13:52:06 -04:00
pg_config.h.win32 Add BSD authentication method. 2016-04-08 13:52:06 -04:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Further reduce the number of semaphores used under --disable-spinlocks. 2016-04-18 13:33:06 -04:00
pg_getopt.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_trace.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pgstat.h Remove trailing commas in enums. 2016-04-14 19:25:16 -07:00
pgtar.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pgtime.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
port.h On all Windows platforms, not just Cygwin, use _timezone and _tzname. 2016-03-28 20:59:25 -04:00
postgres.h Adjust DatumGetBool macro, this time for sure. 2016-04-28 11:50:58 -04:00
postgres_ext.h pgindent run for 9.4 2014-05-06 12:12:18 -04:00
postgres_fe.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
rusagestub.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
windowapi.h Update copyright for 2016 2016-01-02 13:33:40 -05:00