88 * Portions Copyright (c) 1994, Regents of the University of California
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/backend/catalog/toasting.c,v 1.16 2009/06/11 14:48:55 momjian Exp $
11+ * $PostgreSQL: pgsql/src/backend/catalog/toasting.c,v 1.17 2009/06/11 20:46:11 tgl Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -43,6 +43,11 @@ static bool needs_toast_table(Relation rel);
4343 * then create a toast table for it. (With the force option, make
4444 * a toast table even if it appears unnecessary.)
4545 *
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+ *
4651 * reloptions for the toast table can be passed, too. Pass (Datum) 0
4752 * for default reloptions.
4853 *
@@ -51,7 +56,8 @@ static bool needs_toast_table(Relation rel);
5156 * to end with CommandCounterIncrement if it makes any changes.
5257 */
5358void
54- AlterTableCreateToastTable (Oid relOid , Datum reloptions , bool force )
59+ AlterTableCreateToastTable (Oid relOid , Oid toastOid ,
60+ Datum reloptions , bool force )
5561{
5662 Relation rel ;
5763
@@ -63,7 +69,7 @@ AlterTableCreateToastTable(Oid relOid, Datum reloptions, bool force)
6369 rel = heap_open (relOid , AccessExclusiveLock );
6470
6571 /* 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 );
6773
6874 heap_close (rel , NoLock );
6975}
@@ -101,8 +107,8 @@ BootstrapToastTable(char *relName, Oid toastOid, Oid toastIndexOid)
101107 * create_toast_table --- internal workhorse
102108 *
103109 * rel is already opened and exclusive-locked
104- * toastOid and toastIndexOid are normally InvalidOid, but during
105- * bootstrap they can be nonzero to specify hand -assigned OIDs
110+ * toastOid and toastIndexOid are normally InvalidOid, but
111+ * either or both can be nonzero to specify caller -assigned OIDs
106112 */
107113static bool
108114create_toast_table (Relation rel , Oid toastOid , Oid toastIndexOid ,
0 commit comments