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

Commitf20cad7

Browse files
committed
Preserve tuple OIDs during ATRewriteTable. Per gripe from Duncan Crombie.
1 parent4361e0d commitf20cad7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.172 2005/10/02 23:50:08 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.173 2005/10/03 02:45:12 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2509,8 +2509,12 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap)
25092509
{
25102510
if (newrel)
25112511
{
2512+
OidtupOid=InvalidOid;
2513+
25122514
/* Extract data from old tuple */
25132515
heap_deform_tuple(tuple,oldTupDesc,values,isnull);
2516+
if (oldTupDesc->tdhasoid)
2517+
tupOid=HeapTupleGetOid(tuple);
25142518

25152519
/* Set dropped attributes to null in new tuple */
25162520
foreach (lc,dropped_attrs)
@@ -2539,6 +2543,10 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap)
25392543
* be reset shortly.
25402544
*/
25412545
tuple=heap_form_tuple(newTupDesc,values,isnull);
2546+
2547+
/* Preserve OID, if any */
2548+
if (newTupDesc->tdhasoid)
2549+
HeapTupleSetOid(tuple,tupOid);
25422550
}
25432551

25442552
/* Now check any constraints on the possibly-changed tuple */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp