99 *
1010 *
1111 * IDENTIFICATION
12- * $PostgreSQL: pgsql/src/backend/commands/tsearchcmds.c,v 1.1 2007/08/2101:11:15 tgl Exp $
12+ * $PostgreSQL: pgsql/src/backend/commands/tsearchcmds.c,v 1.2 2007/08/2121:24:00 tgl Exp $
1313 *
1414 *-------------------------------------------------------------------------
1515 */
@@ -1192,10 +1192,9 @@ DefineTSConfiguration(List *names, List *parameters)
11921192Oid namespaceoid ;
11931193char * cfgname ;
11941194NameData cname ;
1195- List * templateName = NIL ;
1196- Oid templateOid = InvalidOid ;
1195+ List * sourceName = NIL ;
1196+ Oid sourceOid = InvalidOid ;
11971197Oid prsOid = InvalidOid ;
1198- bool with_map = false;
11991198Oid cfgOid ;
12001199ListCell * pl ;
12011200
@@ -1217,10 +1216,8 @@ DefineTSConfiguration(List *names, List *parameters)
12171216
12181217if (pg_strcasecmp (defel -> defname ,"parser" )== 0 )
12191218prsOid = TSParserGetPrsid (defGetQualifiedName (defel ), false);
1220- else if (pg_strcasecmp (defel -> defname ,"template" )== 0 )
1221- templateName = defGetQualifiedName (defel );
1222- else if (pg_strcasecmp (defel -> defname ,"map" )== 0 )
1223- with_map = defGetBoolean (defel );
1219+ else if (pg_strcasecmp (defel -> defname ,"copy" )== 0 )
1220+ sourceName = defGetQualifiedName (defel );
12241221else
12251222ereport (ERROR ,
12261223(errcode (ERRCODE_SYNTAX_ERROR ),
@@ -1229,26 +1226,24 @@ DefineTSConfiguration(List *names, List *parameters)
12291226}
12301227
12311228/*
1232- * Look up template if given. XXX the "template" is an existing config
1233- * that we copy, not a pg_ts_template entry. This seems confusing.
1234- * Maybe should use "source" or some other word?
1229+ * Look up source config if given.
12351230 */
1236- if (templateName )
1231+ if (sourceName )
12371232{
12381233Form_pg_ts_config cfg ;
12391234
1240- templateOid = TSConfigGetCfgid (templateName , false);
1235+ sourceOid = TSConfigGetCfgid (sourceName , false);
12411236
12421237tup = SearchSysCache (TSCONFIGOID ,
1243- ObjectIdGetDatum (templateOid ),
1238+ ObjectIdGetDatum (sourceOid ),
124412390 ,0 ,0 );
12451240if (!HeapTupleIsValid (tup ))
12461241elog (ERROR ,"cache lookup failed for text search configuration %u" ,
1247- templateOid );
1242+ sourceOid );
12481243
12491244cfg = (Form_pg_ts_config )GETSTRUCT (tup );
12501245
1251- /* Usetemplate 's parser if no other was specified */
1246+ /* Usesource 's parser if no other was specified */
12521247if (!OidIsValid (prsOid ))
12531248prsOid = cfg -> cfgparser ;
12541249
@@ -1283,10 +1278,10 @@ DefineTSConfiguration(List *names, List *parameters)
12831278
12841279CatalogUpdateIndexes (cfgRel ,tup );
12851280
1286- if (OidIsValid (templateOid ) && with_map )
1281+ if (OidIsValid (sourceOid ) )
12871282{
12881283/*
1289- * Copy token-dicts map fromtemplate
1284+ * Copy token-dicts map fromsource config
12901285 */
12911286ScanKeyData skey ;
12921287SysScanDesc scan ;
@@ -1297,7 +1292,7 @@ DefineTSConfiguration(List *names, List *parameters)
12971292ScanKeyInit (& skey ,
12981293Anum_pg_ts_config_map_mapcfg ,
12991294BTEqualStrategyNumber ,F_OIDEQ ,
1300- ObjectIdGetDatum (templateOid ));
1295+ ObjectIdGetDatum (sourceOid ));
13011296
13021297scan = systable_beginscan (mapRel ,TSConfigMapIndexId , true,
13031298SnapshotNow ,1 ,& skey );