8
8
* Portions Copyright (c) 1994, Regents of the University of California
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/catalog/toasting.c,v 1.16 2009/06/1114:48:55 momjian Exp $
11
+ * $PostgreSQL: pgsql/src/backend/catalog/toasting.c,v 1.17 2009/06/1120:46:11 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -43,6 +43,11 @@ static bool needs_toast_table(Relation rel);
43
43
*then create a toast table for it. (With the force option, make
44
44
*a toast table even if it appears unnecessary.)
45
45
*
46
+ * The caller can also specify the OID to be used for the toast table.
47
+ * Usually, toastOid should be InvalidOid to allow a free OID to be assigned.
48
+ * (This option, as well as the force option, is not used by core Postgres,
49
+ * but is provided to support pg_migrator.)
50
+ *
46
51
* reloptions for the toast table can be passed, too. Pass (Datum) 0
47
52
* for default reloptions.
48
53
*
@@ -51,7 +56,8 @@ static bool needs_toast_table(Relation rel);
51
56
* to end with CommandCounterIncrement if it makes any changes.
52
57
*/
53
58
void
54
- AlterTableCreateToastTable (Oid relOid ,Datum reloptions ,bool force )
59
+ AlterTableCreateToastTable (Oid relOid ,Oid toastOid ,
60
+ Datum reloptions ,bool force )
55
61
{
56
62
Relation rel ;
57
63
@@ -63,7 +69,7 @@ AlterTableCreateToastTable(Oid relOid, Datum reloptions, bool force)
63
69
rel = heap_open (relOid ,AccessExclusiveLock );
64
70
65
71
/* create_toast_table does all the work */
66
- (void )create_toast_table (rel ,InvalidOid ,InvalidOid ,reloptions ,force );
72
+ (void )create_toast_table (rel ,toastOid ,InvalidOid ,reloptions ,force );
67
73
68
74
heap_close (rel ,NoLock );
69
75
}
@@ -101,8 +107,8 @@ BootstrapToastTable(char *relName, Oid toastOid, Oid toastIndexOid)
101
107
* create_toast_table --- internal workhorse
102
108
*
103
109
* rel is already opened and exclusive-locked
104
- * toastOid and toastIndexOid are normally InvalidOid, but during
105
- *bootstrap they can be nonzero to specifyhand -assigned OIDs
110
+ * toastOid and toastIndexOid are normally InvalidOid, but
111
+ *either or both can be nonzero to specifycaller -assigned OIDs
106
112
*/
107
113
static bool
108
114
create_toast_table (Relation rel ,Oid toastOid ,Oid toastIndexOid ,