Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit56303ab

Browse files
committed
Tweak toast-related logic in heapam.c so that the toaster is only invoked
when relkind = RELKIND_RELATION. This syncs these tests with the Assertsin tuptoaster.c, and ensures that we won't ever try to, for example,compress a sequence's tuple. Problem found by Greg Stark while stress-testingwith much-smaller-than-normal page sizes.
1 parent9a4b29d commit56303ab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/backend/access/heap/heapam.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.242 2007/09/21 21:25:42 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.243 2007/10/16 17:05:26 tgl Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -1758,7 +1758,7 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid,
17581758
* Note: below this point, heaptup is the data we actually intend to store
17591759
* into the relation; tup is the caller's original untoasted data.
17601760
*/
1761-
if (relation->rd_rel->relkind==RELKIND_TOASTVALUE)
1761+
if (relation->rd_rel->relkind!=RELKIND_RELATION)
17621762
{
17631763
/* toast table entries should never be recursively toasted */
17641764
Assert(!HeapTupleHasExternal(tup));
@@ -2125,7 +2125,7 @@ heap_delete(Relation relation, ItemPointer tid,
21252125
* because we need to look at the contents of the tuple, but it's OK to
21262126
* release the content lock on the buffer first.
21272127
*/
2128-
if (relation->rd_rel->relkind==RELKIND_TOASTVALUE)
2128+
if (relation->rd_rel->relkind!=RELKIND_RELATION)
21292129
{
21302130
/* toast table entries should never be recursively toasted */
21312131
Assert(!HeapTupleHasExternal(&tp));
@@ -2440,7 +2440,7 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
24402440
* We need to invoke the toaster if there are already any out-of-line
24412441
* toasted values present, or if the new tuple is over-threshold.
24422442
*/
2443-
if (relation->rd_rel->relkind==RELKIND_TOASTVALUE)
2443+
if (relation->rd_rel->relkind!=RELKIND_RELATION)
24442444
{
24452445
/* toast table entries should never be recursively toasted */
24462446
Assert(!HeapTupleHasExternal(&oldtup));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp