summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2007-08-21 01:11:32 +0000
committerTom Lane2007-08-21 01:11:32 +0000
commit140d4ebcb46e17cdb1be43892ed797e5e060c8ef (patch)
treef99d209dbe5e40dcb434c3841e0c8b4ff383f453 /src/include
parent4e94d1f952c3ce5670ceae3c12b55e344503a701 (diff)
Tsearch2 functionality migrates to core. The bulk of this work is by
Oleg Bartunov and Teodor Sigaev, but I did a lot of editorializing, so anything that's broken is probably my fault. Documentation is nonexistent as yet, but let's land the patch so we can get some portability testing done.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/gin.h6
-rw-r--r--src/include/catalog/catversion.h4
-rw-r--r--src/include/catalog/dependency.h10
-rw-r--r--src/include/catalog/indexing.h25
-rw-r--r--src/include/catalog/namespace.h16
-rw-r--r--src/include/catalog/pg_aggregate.h5
-rw-r--r--src/include/catalog/pg_amop.h37
-rw-r--r--src/include/catalog/pg_amproc.h79
-rw-r--r--src/include/catalog/pg_cast.h16
-rw-r--r--src/include/catalog/pg_opclass.h7
-rw-r--r--src/include/catalog/pg_operator.h30
-rw-r--r--src/include/catalog/pg_opfamily.h10
-rw-r--r--src/include/catalog/pg_proc.h264
-rw-r--r--src/include/catalog/pg_ts_config.h65
-rw-r--r--src/include/catalog/pg_ts_config_map.h83
-rw-r--r--src/include/catalog/pg_ts_dict.h68
-rw-r--r--src/include/catalog/pg_ts_parser.h72
-rw-r--r--src/include/catalog/pg_ts_template.h72
-rw-r--r--src/include/catalog/pg_type.h25
-rw-r--r--src/include/commands/defrem.h31
-rw-r--r--src/include/nodes/nodes.h4
-rw-r--r--src/include/nodes/parsenodes.h37
-rw-r--r--src/include/snowball/header.h62
-rw-r--r--src/include/snowball/libstemmer/api.h26
-rw-r--r--src/include/snowball/libstemmer/header.h58
-rw-r--r--src/include/snowball/libstemmer/stem_ISO_8859_1_danish.h16
-rw-r--r--src/include/snowball/libstemmer/stem_ISO_8859_1_dutch.h16
-rw-r--r--src/include/snowball/libstemmer/stem_ISO_8859_1_english.h16
-rw-r--r--src/include/snowball/libstemmer/stem_ISO_8859_1_finnish.h16
-rw-r--r--src/include/snowball/libstemmer/stem_ISO_8859_1_french.h16
-rw-r--r--src/include/snowball/libstemmer/stem_ISO_8859_1_german.h16
-rw-r--r--src/include/snowball/libstemmer/stem_ISO_8859_1_hungarian.h16
-rw-r--r--src/include/snowball/libstemmer/stem_ISO_8859_1_italian.h16
-rw-r--r--src/include/snowball/libstemmer/stem_ISO_8859_1_norwegian.h16
-rw-r--r--src/include/snowball/libstemmer/stem_ISO_8859_1_porter.h16
-rw-r--r--src/include/snowball/libstemmer/stem_ISO_8859_1_portuguese.h16
-rw-r--r--src/include/snowball/libstemmer/stem_ISO_8859_1_spanish.h16
-rw-r--r--src/include/snowball/libstemmer/stem_ISO_8859_1_swedish.h16
-rw-r--r--src/include/snowball/libstemmer/stem_ISO_8859_2_romanian.h16
-rw-r--r--src/include/snowball/libstemmer/stem_KOI8_R_russian.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_danish.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_dutch.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_english.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_finnish.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_french.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_german.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_hungarian.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_italian.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_norwegian.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_porter.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_portuguese.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_romanian.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_russian.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_spanish.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_swedish.h16
-rw-r--r--src/include/snowball/libstemmer/stem_UTF_8_turkish.h16
-rw-r--r--src/include/tsearch/dicts/regis.h49
-rw-r--r--src/include/tsearch/dicts/spell.h153
-rw-r--r--src/include/tsearch/ts_cache.h98
-rw-r--r--src/include/tsearch/ts_locale.h88
-rw-r--r--src/include/tsearch/ts_public.h128
-rw-r--r--src/include/tsearch/ts_type.h240
-rw-r--r--src/include/tsearch/ts_utils.h315
-rw-r--r--src/include/utils/acl.h6
-rw-r--r--src/include/utils/builtins.h10
-rw-r--r--src/include/utils/syscache.h15
66 files changed, 2655 insertions, 55 deletions
diff --git a/src/include/access/gin.h b/src/include/access/gin.h
index b22fbd1a089..ff76d886dd2 100644
--- a/src/include/access/gin.h
+++ b/src/include/access/gin.h
@@ -2,8 +2,9 @@
* gin.h
* header file for postgres inverted index access method implementation.
*
- * Copyright (c) 2006, PostgreSQL Global Development Group
- * $PostgreSQL: pgsql/src/include/access/gin.h,v 1.12 2007/07/25 12:22:53 mha Exp $
+ * Copyright (c) 2006-2007, PostgreSQL Global Development Group
+ *
+ * $PostgreSQL: pgsql/src/include/access/gin.h,v 1.13 2007/08/21 01:11:22 tgl Exp $
*--------------------------------------------------------------------------
*/
@@ -430,6 +431,7 @@ extern Datum ginvacuumcleanup(PG_FUNCTION_ARGS);
/* ginarrayproc.c */
extern Datum ginarrayextract(PG_FUNCTION_ARGS);
+extern Datum ginqueryarrayextract(PG_FUNCTION_ARGS);
extern Datum ginarrayconsistent(PG_FUNCTION_ARGS);
/* ginbulk.c */
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index e2bd4ec316d..a050ff1d3cc 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.415 2007/07/25 22:16:18 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.416 2007/08/21 01:11:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200707251
+#define CATALOG_VERSION_NO 200708201
#endif
diff --git a/src/include/catalog/dependency.h b/src/include/catalog/dependency.h
index 4196e5b4ad7..6a00f2c4fb9 100644
--- a/src/include/catalog/dependency.h
+++ b/src/include/catalog/dependency.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/dependency.h,v 1.29 2007/01/05 22:19:52 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/dependency.h,v 1.30 2007/08/21 01:11:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -137,6 +137,10 @@ typedef enum ObjectClass
OCLASS_REWRITE, /* pg_rewrite */
OCLASS_TRIGGER, /* pg_trigger */
OCLASS_SCHEMA, /* pg_namespace */
+ OCLASS_TSPARSER, /* pg_ts_parser */
+ OCLASS_TSDICT, /* pg_ts_dict */
+ OCLASS_TSTEMPLATE, /* pg_ts_template */
+ OCLASS_TSCONFIG, /* pg_ts_config */
OCLASS_ROLE, /* pg_authid */
OCLASS_DATABASE, /* pg_database */
OCLASS_TBLSPACE, /* pg_tablespace */
@@ -176,6 +180,10 @@ extern void add_exact_object_address(const ObjectAddress *object,
extern bool object_address_present(const ObjectAddress *object,
ObjectAddresses *addrs);
+extern void record_object_address_dependencies(const ObjectAddress *depender,
+ ObjectAddresses *referenced,
+ DependencyType behavior);
+
extern void free_object_addresses(ObjectAddresses *addrs);
/* in pg_depend.c */
diff --git a/src/include/catalog/indexing.h b/src/include/catalog/indexing.h
index 71970d48f74..4859778f935 100644
--- a/src/include/catalog/indexing.h
+++ b/src/include/catalog/indexing.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/indexing.h,v 1.99 2007/04/02 03:49:40 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/indexing.h,v 1.100 2007/08/21 01:11:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -224,6 +224,29 @@ DECLARE_UNIQUE_INDEX(pg_trigger_tgrelid_tgname_index, 2701, on pg_trigger using
DECLARE_UNIQUE_INDEX(pg_trigger_oid_index, 2702, on pg_trigger using btree(oid oid_ops));
#define TriggerOidIndexId 2702
+DECLARE_UNIQUE_INDEX(pg_ts_config_cfgname_index, 3608, on pg_ts_config using btree(cfgname name_ops, cfgnamespace oid_ops));
+#define TSConfigNameNspIndexId 3608
+DECLARE_UNIQUE_INDEX(pg_ts_config_oid_index, 3712, on pg_ts_config using btree(oid oid_ops));
+#define TSConfigOidIndexId 3712
+
+DECLARE_UNIQUE_INDEX(pg_ts_config_map_index, 3609, on pg_ts_config_map using btree(mapcfg oid_ops, maptokentype int4_ops, mapseqno int4_ops));
+#define TSConfigMapIndexId 3609
+
+DECLARE_UNIQUE_INDEX(pg_ts_dict_dictname_index, 3604, on pg_ts_dict using btree(dictname name_ops, dictnamespace oid_ops));
+#define TSDictionaryNameNspIndexId 3604
+DECLARE_UNIQUE_INDEX(pg_ts_dict_oid_index, 3605, on pg_ts_dict using btree(oid oid_ops));
+#define TSDictionaryOidIndexId 3605
+
+DECLARE_UNIQUE_INDEX(pg_ts_parser_prsname_index, 3606, on pg_ts_parser using btree(prsname name_ops, prsnamespace oid_ops));
+#define TSParserNameNspIndexId 3606
+DECLARE_UNIQUE_INDEX(pg_ts_parser_oid_index, 3607, on pg_ts_parser using btree(oid oid_ops));
+#define TSParserOidIndexId 3607
+
+DECLARE_UNIQUE_INDEX(pg_ts_template_tmplname_index, 3766, on pg_ts_template using btree(tmplname name_ops, tmplnamespace oid_ops));
+#define TSTemplateNameNspIndexId 3766
+DECLARE_UNIQUE_INDEX(pg_ts_template_oid_index, 3767, on pg_ts_template using btree(oid oid_ops));
+#define TSTemplateOidIndexId 3767
+
DECLARE_UNIQUE_INDEX(pg_type_oid_index, 2703, on pg_type using btree(oid oid_ops));
#define TypeOidIndexId 2703
DECLARE_UNIQUE_INDEX(pg_type_typname_nsp_index, 2704, on pg_type using btree(typname name_ops, typnamespace oid_ops));
diff --git a/src/include/catalog/namespace.h b/src/include/catalog/namespace.h
index f937a729060..a486df1c797 100644
--- a/src/include/catalog/namespace.h
+++ b/src/include/catalog/namespace.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/namespace.h,v 1.48 2007/07/25 22:16:18 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/namespace.h,v 1.49 2007/08/21 01:11:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -30,7 +30,7 @@ typedef struct _FuncCandidateList
Oid oid; /* the function or operator's OID */
int nargs; /* number of arg types returned */
Oid args[1]; /* arg types --- VARIABLE LENGTH ARRAY */
-} *FuncCandidateList; /* VARIABLE LENGTH STRUCT */
+} *FuncCandidateList; /* VARIABLE LENGTH STRUCT */
/*
* Structure for xxxOverrideSearchPath functions
@@ -67,6 +67,18 @@ extern bool OpfamilyIsVisible(Oid opfid);
extern Oid ConversionGetConid(const char *conname);
extern bool ConversionIsVisible(Oid conid);
+extern Oid TSParserGetPrsid(List *names, bool failOK);
+extern bool TSParserIsVisible(Oid prsId);
+
+extern Oid TSDictionaryGetDictid(List *names, bool failOK);
+extern bool TSDictionaryIsVisible(Oid dictId);
+
+extern Oid TSTemplateGetTmplid(List *names, bool failOK);
+extern bool TSTemplateIsVisible(Oid tmplId);
+
+extern Oid TSConfigGetCfgid(List *names, bool failOK);
+extern bool TSConfigIsVisible(Oid cfgid);
+
extern void DeconstructQualifiedName(List *names,
char **nspname_p,
char **objname_p);
diff --git a/src/include/catalog/pg_aggregate.h b/src/include/catalog/pg_aggregate.h
index 0ee798b356e..a459e3b0d49 100644
--- a/src/include/catalog/pg_aggregate.h
+++ b/src/include/catalog/pg_aggregate.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_aggregate.h,v 1.62 2007/04/02 03:49:40 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_aggregate.h,v 1.63 2007/08/21 01:11:25 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -226,6 +226,9 @@ DATA(insert ( 2243 bitor - 0 1560 _null_ ));
/* xml */
DATA(insert ( 2901 xmlconcat2 - 0 142 _null_ ));
+/* text search */
+DATA(insert ( 3688 ts_rewrite_accum ts_rewrite_finish 0 3615 _null_ ));
+
/*
* prototypes for functions in pg_aggregate.c
*/
diff --git a/src/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h
index 26b2ffe4ede..ac0a2ed8689 100644
--- a/src/include/catalog/pg_amop.h
+++ b/src/include/catalog/pg_amop.h
@@ -29,7 +29,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_amop.h,v 1.81 2007/05/08 18:56:47 neilc Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_amop.h,v 1.82 2007/08/21 01:11:25 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -652,4 +652,39 @@ DATA(insert ( 3522 3500 3500 5 f 3519 403 ));
*/
DATA(insert ( 3523 3500 3500 1 f 3516 405 ));
+/*
+ * btree tsvector_ops
+ */
+DATA(insert ( 3626 3614 3614 1 f 3627 403 ));
+DATA(insert ( 3626 3614 3614 2 f 3628 403 ));
+DATA(insert ( 3626 3614 3614 3 f 3629 403 ));
+DATA(insert ( 3626 3614 3614 4 f 3631 403 ));
+DATA(insert ( 3626 3614 3614 5 f 3632 403 ));
+
+/*
+ * GiST tsvector_ops
+ */
+DATA(insert ( 3655 3614 3615 1 t 3636 783 ));
+
+/*
+ * GIN tsvector_ops
+ */
+DATA(insert ( 3659 3614 3615 1 f 3636 2742 ));
+DATA(insert ( 3659 3614 3615 2 t 3660 2742 ));
+
+/*
+ * btree tsquery_ops
+ */
+DATA(insert ( 3683 3615 3615 1 f 3674 403 ));
+DATA(insert ( 3683 3615 3615 2 f 3675 403 ));
+DATA(insert ( 3683 3615 3615 3 f 3676 403 ));
+DATA(insert ( 3683 3615 3615 4 f 3678 403 ));
+DATA(insert ( 3683 3615 3615 5 f 3679 403 ));
+
+/*
+ * GiST tsquery_ops
+ */
+DATA(insert ( 3702 3615 3615 7 t 3693 783 ));
+DATA(insert ( 3702 3615 3615 8 t 3694 783 ));
+
#endif /* PG_AMOP_H */
diff --git a/src/include/catalog/pg_amproc.h b/src/include/catalog/pg_amproc.h
index c31a09f2243..a89ed470606 100644
--- a/src/include/catalog/pg_amproc.h
+++ b/src/include/catalog/pg_amproc.h
@@ -22,7 +22,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_amproc.h,v 1.66 2007/07/06 04:15:59 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_amproc.h,v 1.67 2007/08/21 01:11:25 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -189,119 +189,140 @@ DATA(insert ( 2595 718 718 4 2580 ));
DATA(insert ( 2595 718 718 5 2581 ));
DATA(insert ( 2595 718 718 6 2582 ));
DATA(insert ( 2595 718 718 7 2584 ));
+DATA(insert ( 3655 3614 3614 1 3654 ));
+DATA(insert ( 3655 3614 3614 2 3651 ));
+DATA(insert ( 3655 3614 3614 3 3648 ));
+DATA(insert ( 3655 3614 3614 4 3649 ));
+DATA(insert ( 3655 3614 3614 5 3653 ));
+DATA(insert ( 3655 3614 3614 6 3650 ));
+DATA(insert ( 3655 3614 3614 7 3652 ));
+DATA(insert ( 3702 3615 3615 1 3701 ));
+DATA(insert ( 3702 3615 3615 2 3698 ));
+DATA(insert ( 3702 3615 3615 3 3695 ));
+DATA(insert ( 3702 3615 3615 4 3696 ));
+DATA(insert ( 3702 3615 3615 5 3700 ));
+DATA(insert ( 3702 3615 3615 6 3697 ));
+DATA(insert ( 3702 3615 3615 7 3699 ));
+
/* gin */
DATA(insert ( 2745 1007 1007 1 351 ));
DATA(insert ( 2745 1007 1007 2 2743 ));
-DATA(insert ( 2745 1007 1007 3 2743 ));
+DATA(insert ( 2745 1007 1007 3 2774 ));
DATA(insert ( 2745 1007 1007 4 2744 ));
DATA(insert ( 2745 1009 1009 1 360 ));
DATA(insert ( 2745 1009 1009 2 2743 ));
-DATA(insert ( 2745 1009 1009 3 2743 ));
+DATA(insert ( 2745 1009 1009 3 2774 ));
DATA(insert ( 2745 1009 1009 4 2744 ));
DATA(insert ( 2745 1023 1023 1 357 ));
DATA(insert ( 2745 1023 1023 2 2743 ));
-DATA(insert ( 2745 1023 1023 3 2743 ));
+DATA(insert ( 2745 1023 1023 3 2774 ));
DATA(insert ( 2745 1023 1023 4 2744 ));
DATA(insert ( 2745 1561 1561 1 1596 ));
DATA(insert ( 2745 1561 1561 2 2743 ));
-DATA(insert ( 2745 1561 1561 3 2743 ));
+DATA(insert ( 2745 1561 1561 3 2774 ));
DATA(insert ( 2745 1561 1561 4 2744 ));
DATA(insert ( 2745 1000 1000 1 1693 ));
DATA(insert ( 2745 1000 1000 2 2743 ));
-DATA(insert ( 2745 1000 1000 3 2743 ));
+DATA(insert ( 2745 1000 1000 3 2774 ));
DATA(insert ( 2745 1000 1000 4 2744 ));
DATA(insert ( 2745 1014 1014 1 1078 ));
DATA(insert ( 2745 1014 1014 2 2743 ));
-DATA(insert ( 2745 1014 1014 3 2743 ));
+DATA(insert ( 2745 1014 1014 3 2774 ));
DATA(insert ( 2745 1014 1014 4 2744 ));
DATA(insert ( 2745 1001 1001 1 1954 ));
DATA(insert ( 2745 1001 1001 2 2743 ));
-DATA(insert ( 2745 1001 1001 3 2743 ));
+DATA(insert ( 2745 1001 1001 3 2774 ));
DATA(insert ( 2745 1001 1001 4 2744 ));
DATA(insert ( 2745 1002 1002 1 358 ));
DATA(insert ( 2745 1002 1002 2 2743 ));
-DATA(insert ( 2745 1002 1002 3 2743 ));
+DATA(insert ( 2745 1002 1002 3 2774 ));
DATA(insert ( 2745 1002 1002 4 2744 ));
DATA(insert ( 2745 1182 1182 1 1092 ));
DATA(insert ( 2745 1182 1182 2 2743 ));
-DATA(insert ( 2745 1182 1182 3 2743 ));
+DATA(insert ( 2745 1182 1182 3 2774 ));
DATA(insert ( 2745 1182 1182 4 2744 ));
DATA(insert ( 2745 1021 1021 1 354 ));
DATA(insert ( 2745 1021 1021 2 2743 ));
-DATA(insert ( 2745 1021 1021 3 2743 ));
+DATA(insert ( 2745 1021 1021 3 2774 ));
DATA(insert ( 2745 1021 1021 4 2744 ));
DATA(insert ( 2745 1022 1022 1 355 ));
DATA(insert ( 2745 1022 1022 2 2743 ));
-DATA(insert ( 2745 1022 1022 3 2743 ));
+DATA(insert ( 2745 1022 1022 3 2774 ));
DATA(insert ( 2745 1022 1022 4 2744 ));
DATA(insert ( 2745 1041 1041 1 926 ));
DATA(insert ( 2745 1041 1041 2 2743 ));
-DATA(insert ( 2745 1041 1041 3 2743 ));
+DATA(insert ( 2745 1041 1041 3 2774 ));
DATA(insert ( 2745 1041 1041 4 2744 ));
DATA(insert ( 2745 1005 1005 1 350 ));
DATA(insert ( 2745 1005 1005 2 2743 ));
-DATA(insert ( 2745 1005 1005 3 2743 ));
+DATA(insert ( 2745 1005 1005 3 2774 ));
DATA(insert ( 2745 1005 1005 4 2744 ));
DATA(insert ( 2745 1016 1016 1 842 ));
DATA(insert ( 2745 1016 1016 2 2743 ));
-DATA(insert ( 2745 1016 1016 3 2743 ));
+DATA(insert ( 2745 1016 1016 3 2774 ));
DATA(insert ( 2745 1016 1016 4 2744 ));
DATA(insert ( 2745 1187 1187 1 1315 ));
DATA(insert ( 2745 1187 1187 2 2743 ));
-DATA(insert ( 2745 1187 1187 3 2743 ));
+DATA(insert ( 2745 1187 1187 3 2774 ));
DATA(insert ( 2745 1187 1187 4 2744 ));
DATA(insert ( 2745 1040 1040 1 836 ));
DATA(insert ( 2745 1040 1040 2 2743 ));
-DATA(insert ( 2745 1040 1040 3 2743 ));
+DATA(insert ( 2745 1040 1040 3 2774 ));
DATA(insert ( 2745 1040 1040 4 2744 ));
DATA(insert ( 2745 1003 1003 1 359 ));
DATA(insert ( 2745 1003 1003 2 2743 ));
-DATA(insert ( 2745 1003 1003 3 2743 ));
+DATA(insert ( 2745 1003 1003 3 2774 ));
DATA(insert ( 2745 1003 1003 4 2744 ));
DATA(insert ( 2745 1231 1231 1 1769 ));
DATA(insert ( 2745 1231 1231 2 2743 ));
-DATA(insert ( 2745 1231 1231 3 2743 ));
+DATA(insert ( 2745 1231 1231 3 2774 ));
DATA(insert ( 2745 1231 1231 4 2744 ));
DATA(insert ( 2745 1028 1028 1 356 ));
DATA(insert ( 2745 1028 1028 2 2743 ));
-DATA(insert ( 2745 1028 1028 3 2743 ));
+DATA(insert ( 2745 1028 1028 3 2774 ));
DATA(insert ( 2745 1028 1028 4 2744 ));
DATA(insert ( 2745 1013 1013 1 404 ));
DATA(insert ( 2745 1013 1013 2 2743 ));
-DATA(insert ( 2745 1013 1013 3 2743 ));
+DATA(insert ( 2745 1013 1013 3 2774 ));
DATA(insert ( 2745 1013 1013 4 2744 ));
DATA(insert ( 2745 1183 1183 1 1107 ));
DATA(insert ( 2745 1183 1183 2 2743 ));
-DATA(insert ( 2745 1183 1183 3 2743 ));
+DATA(insert ( 2745 1183 1183 3 2774 ));
DATA(insert ( 2745 1183 1183 4 2744 ));
DATA(insert ( 2745 1185 1185 1 1314 ));
DATA(insert ( 2745 1185 1185 2 2743 ));
-DATA(insert ( 2745 1185 1185 3 2743 ));
+DATA(insert ( 2745 1185 1185 3 2774 ));
DATA(insert ( 2745 1185 1185 4 2744 ));
DATA(insert ( 2745 1270 1270 1 1358 ));
DATA(insert ( 2745 1270 1270 2 2743 ));
-DATA(insert ( 2745 1270 1270 3 2743 ));
+DATA(insert ( 2745 1270 1270 3 2774 ));
DATA(insert ( 2745 1270 1270 4 2744 ));
DATA(insert ( 2745 1563 1563 1 1672 ));
DATA(insert ( 2745 1563 1563 2 2743 ));
-DATA(insert ( 2745 1563 1563 3 2743 ));
+DATA(insert ( 2745 1563 1563 3 2774 ));
DATA(insert ( 2745 1563 1563 4 2744 ));
DATA(insert ( 2745 1115 1115 1 2045 ));
DATA(insert ( 2745 1115 1115 2 2743 ));
-DATA(insert ( 2745 1115 1115 3 2743 ));
+DATA(insert ( 2745 1115 1115 3 2774 ));
DATA(insert ( 2745 1115 1115 4 2744 ));
DATA(insert ( 2745 791 791 1 377 ));
DATA(insert ( 2745 791 791 2 2743 ));
-DATA(insert ( 2745 791 791 3 2743 ));
+DATA(insert ( 2745 791 791 3 2774 ));
DATA(insert ( 2745 791 791 4 2744 ));
DATA(insert ( 2745 1024 1024 1 380 ));
DATA(insert ( 2745 1024 1024 2 2743 ));
-DATA(insert ( 2745 1024 1024 3 2743 ));
+DATA(insert ( 2745 1024 1024 3 2774 ));
DATA(insert ( 2745 1024 1024 4 2744 ));
DATA(insert ( 2745 1025 1025 1 381 ));
DATA(insert ( 2745 1025 1025 2 2743 ));
-DATA(insert ( 2745 1025 1025 3 2743 ));
+DATA(insert ( 2745 1025 1025 3 2774 ));
DATA(insert ( 2745 1025 1025 4 2744 ));
+DATA(insert ( 3659 3614 3614 1 360 ));
+DATA(insert ( 3659 3614 3614 2 3656 ));
+DATA(insert ( 3659 3614 3614 3 3657 ));
+DATA(insert ( 3659 3614 3614 4 3658 ));
+DATA(insert ( 3626 3614 3614 1 3622 ));
+DATA(insert ( 3683 3615 3615 1 3668 ));
#endif /* PG_AMPROC_H */
diff --git a/src/include/catalog/pg_cast.h b/src/include/catalog/pg_cast.h
index 82016774e80..2fe1cf03835 100644
--- a/src/include/catalog/pg_cast.h
+++ b/src/include/catalog/pg_cast.h
@@ -10,7 +10,7 @@
*
* Copyright (c) 2002-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_cast.h,v 1.34 2007/06/05 21:31:07 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_cast.h,v 1.35 2007/08/21 01:11:25 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -169,6 +169,20 @@ DATA(insert ( 21 2206 313 i ));
DATA(insert ( 23 2206 0 i ));
DATA(insert ( 2206 20 1288 a ));
DATA(insert ( 2206 23 0 a ));
+DATA(insert ( 26 3734 0 i ));
+DATA(insert ( 3734 26 0 i ));
+DATA(insert ( 20 3734 1287 i ));
+DATA(insert ( 21 3734 313 i ));
+DATA(insert ( 23 3734 0 i ));
+DATA(insert ( 3734 20 1288 a ));
+DATA(insert ( 3734 23 0 a ));
+DATA(insert ( 26 3769 0 i ));
+DATA(insert ( 3769 26 0 i ));
+DATA(insert ( 20 3769 1287 i ));
+DATA(insert ( 21 3769 313 i ));
+DATA(insert ( 23 3769 0 i ));
+DATA(insert ( 3769 20 1288 a ));
+DATA(insert ( 3769 23 0 a ));
DATA(insert ( 25 2205 1079 i ));
DATA(insert ( 1043 2205 1079 i ));
diff --git a/src/include/catalog/pg_opclass.h b/src/include/catalog/pg_opclass.h
index 28fed113014..8674fe027cd 100644
--- a/src/include/catalog/pg_opclass.h
+++ b/src/include/catalog/pg_opclass.h
@@ -28,7 +28,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_opclass.h,v 1.76 2007/05/08 18:56:47 neilc Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_opclass.h,v 1.77 2007/08/21 01:11:25 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -205,5 +205,10 @@ DATA(insert ( 403 uuid_ops PGNSP PGUID 2968 2950 t 0 ));
DATA(insert ( 405 uuid_ops PGNSP PGUID 2969 2950 t 0 ));
DATA(insert ( 403 enum_ops PGNSP PGUID 3522 3500 t 0 ));
DATA(insert ( 405 enum_ops PGNSP PGUID 3523 3500 t 0 ));
+DATA(insert ( 403 tsvector_ops PGNSP PGUID 3626 3614 t 0 ));
+DATA(insert ( 783 tsvector_ops PGNSP PGUID 3655 3614 t 3642 ));
+DATA(insert ( 2742 tsvector_ops PGNSP PGUID 3659 3614 t 25 ));
+DATA(insert ( 403 tsquery_ops PGNSP PGUID 3683 3615 t 0 ));
+DATA(insert ( 783 tsquery_ops PGNSP PGUID 3702 3615 t 20 ));
#endif /* PG_OPCLASS_H */
diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h
index e3b2910eb22..4b6f2575574 100644
--- a/src/include/catalog/pg_operator.h
+++ b/src/include/catalog/pg_operator.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.153 2007/06/06 23:00:41 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.154 2007/08/21 01:11:25 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -915,6 +915,34 @@ DATA(insert OID = 3519 ( ">" PGNSP PGUID b f f 3500 3500 16 3518 3520 enum_g
DATA(insert OID = 3520 ( "<=" PGNSP PGUID b f f 3500 3500 16 3521 3519 enum_le scalarltsel scalarltjoinsel ));
DATA(insert OID = 3521 ( ">=" PGNSP PGUID b f f 3500 3500 16 3520 3518 enum_ge scalargtsel scalargtjoinsel ));
+/*
+ * tsearch operations
+ */
+DATA(insert OID = 3627 ( "<" PGNSP PGUID b f f 3614 3614 16 3632 3631 tsvector_lt scalarltsel scalarltjoinsel ));
+DATA(insert OID = 3628 ( "<=" PGNSP PGUID b f f 3614 3614 16 3631 3632 tsvector_le scalarltsel scalarltjoinsel ));
+DATA(insert OID = 3629 ( "=" PGNSP PGUID b t f 3614 3614 16 3629 3630 tsvector_eq eqsel eqjoinsel ));
+DATA(insert OID = 3630 ( "<>" PGNSP PGUID b f f 3614 3614 16 3630 3629 tsvector_ne neqsel neqjoinsel ));
+DATA(insert OID = 3631 ( ">=" PGNSP PGUID b f f 3614 3614 16 3628 3627 tsvector_ge scalargtsel scalargtjoinsel ));
+DATA(insert OID = 3632 ( ">" PGNSP PGUID b f f 3614 3614 16 3627 3628 tsvector_gt scalargtsel scalargtjoinsel ));
+DATA(insert OID = 3633 ( "||" PGNSP PGUID b f f 3614 3614 3614 0 0 tsvector_concat - - ));
+DATA(insert OID = 3636 ( "@@" PGNSP PGUID b f f 3614 3615 16 3637 0 ts_match_vq contsel contjoinsel ));
+DATA(insert OID = 3637 ( "@@" PGNSP PGUID b f f 3615 3614 16 3636 0 ts_match_qv contsel contjoinsel ));
+DATA(insert OID = 3660 ( "@@@" PGNSP PGUID b f f 3614 3615 16 3661 0 ts_match_vq contsel contjoinsel ));
+DATA(insert OID = 3661 ( "@@@" PGNSP PGUID b f f 3615 3614 16 3660 0 ts_match_qv contsel contjoinsel ));
+DATA(insert OID = 3674 ( "<" PGNSP PGUID b f f 3615 3615 16 3679 3678 tsquery_lt scalarltsel scalarltjoinsel ));
+DATA(insert OID = 3675 ( "<=" PGNSP PGUID b f f 3615 3615 16 3678 3679 tsquery_le scalarltsel scalarltjoinsel ));
+DATA(insert OID = 3676 ( "=" PGNSP PGUID b t f 3615 3615 16 3676 3677 tsquery_eq eqsel eqjoinsel ));
+DATA(insert OID = 3677 ( "<>" PGNSP PGUID b f f 3615 3615 16 3677 3676 tsquery_ne neqsel neqjoinsel ));
+DATA(insert OID = 3678 ( ">=" PGNSP PGUID b f f 3615 3615 16 3675 3674 tsquery_ge scalargtsel scalargtjoinsel ));
+DATA(insert OID = 3679 ( ">" PGNSP PGUID b f f 3615 3615 16 3674 3675 tsquery_gt scalargtsel scalargtjoinsel ));
+DATA(insert OID = 3680 ( "&&" PGNSP PGUID b f f 3615 3615 3615 0 0 tsquery_and - - ));
+DATA(insert OID = 3681 ( "||" PGNSP PGUID b f f 3615 3615 3615 0 0 tsquery_or - - ));
+DATA(insert OID = 3682 ( "!!" PGNSP PGUID l f f 0 3615 3615 0 0 tsquery_not - - ));
+DATA(insert OID = 3693 ( "@>" PGNSP PGUID b f f 3615 3615 16 3694 0 tsq_mcontains contsel contjoinsel ));
+DATA(insert OID = 3694 ( "<@" PGNSP PGUID b f f 3615 3615 16 3693 0 tsq_mcontained contsel contjoinsel ));
+DATA(insert OID = 3762 ( "@@" PGNSP PGUID b f f 25 25 16 0 0 ts_match_tt contsel contjoinsel ));
+DATA(insert OID = 3763 ( "@@" PGNSP PGUID b f f 25 3615 16 0 0 ts_match_tq contsel contjoinsel ));
+
/*
* function prototypes
diff --git a/src/include/catalog/pg_opfamily.h b/src/include/catalog/pg_opfamily.h
index a39e28c632d..702ec8d6e3e 100644
--- a/src/include/catalog/pg_opfamily.h
+++ b/src/include/catalog/pg_opfamily.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_opfamily.h,v 1.5 2007/05/08 18:56:47 neilc Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_opfamily.h,v 1.6 2007/08/21 01:11:25 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -27,7 +27,7 @@
*/
/* ----------------
- * pg_opfamily definition. cpp turns this into
+ * pg_opfamily definition. cpp turns this into
* typedef struct FormData_pg_opfamily
* ----------------
*/
@@ -139,6 +139,10 @@ DATA(insert OID = 2968 ( 403 uuid_ops PGNSP PGUID ));
DATA(insert OID = 2969 ( 405 uuid_ops PGNSP PGUID ));
DATA(insert OID = 3522 ( 403 enum_ops PGNSP PGUID ));
DATA(insert OID = 3523 ( 405 enum_ops PGNSP PGUID ));
-
+DATA(insert OID = 3626 ( 403 tsvector_ops PGNSP PGUID ));
+DATA(insert OID = 3655 ( 783 tsvector_ops PGNSP PGUID ));
+DATA(insert OID = 3659 ( 2742 tsvector_ops PGNSP PGUID ));
+DATA(insert OID = 3683 ( 403 tsquery_ops PGNSP PGUID ));
+DATA(insert OID = 3702 ( 783 tsquery_ops PGNSP PGUID ));
#endif /* PG_OPFAMILY_H */
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index 024be90487b..1a624c6dbe0 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.462 2007/07/06 04:15:59 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.463 2007/08/21 01:11:25 tgl Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
@@ -3124,6 +3124,15 @@ DATA(insert OID = 2083 ( pg_opclass_is_visible PGNSP PGUID 12 1 0 f f t f s 1
DESCR("is opclass visible in search path?");
DATA(insert OID = 2093 ( pg_conversion_is_visible PGNSP PGUID 12 1 0 f f t f s 1 16 "26" _null_ _null_ _null_ pg_conversion_is_visible - _null_ ));
DESCR("is conversion visible in search path?");
+DATA(insert OID = 3756 ( pg_ts_parser_is_visible PGNSP PGUID 12 1 0 f f t f s 1 16 "26" _null_ _null_ _null_ pg_ts_parser_is_visible - _null_ ));
+DESCR("is text search parser visible in search path?");
+DATA(insert OID = 3757 ( pg_ts_dict_is_visible PGNSP PGUID 12 1 0 f f t f s 1 16 "26" _null_ _null_ _null_ pg_ts_dict_is_visible - _null_ ));
+DESCR("is text search dictionary visible in search path?");
+DATA(insert OID = 3768 ( pg_ts_template_is_visible PGNSP PGUID 12 1 0 f f t f s 1 16 "26" _null_ _null_ _null_ pg_ts_template_is_visible - _null_ ));
+DESCR("is text search template visible in search path?");
+DATA(insert OID = 3758 ( pg_ts_config_is_visible PGNSP PGUID 12 1 0 f f t f s 1 16 "26" _null_ _null_ _null_ pg_ts_config_is_visible - _null_ ));
+DESCR("is text search configuration visible in search path?");
+
DATA(insert OID = 2854 ( pg_my_temp_schema PGNSP PGUID 12 1 0 f f t f s 0 26 "" _null_ _null_ _null_ pg_my_temp_schema - _null_ ));
DESCR("get OID of current session's temp schema, if any");
DATA(insert OID = 2855 ( pg_is_other_temp_schema PGNSP PGUID 12 1 0 f f t f s 1 16 "26" _null_ _null_ _null_ pg_is_other_temp_schema - _null_ ));
@@ -3969,6 +3978,8 @@ DESCR("gin(internal)");
/* GIN array support */
DATA(insert OID = 2743 ( ginarrayextract PGNSP PGUID 12 1 0 f f t f i 2 2281 "2277 2281" _null_ _null_ _null_ ginarrayextract - _null_ ));
DESCR("GIN array support");
+DATA(insert OID = 2774 ( ginqueryarrayextract PGNSP PGUID 12 1 0 f f t f i 3 2281 "2277 2281 21" _null_ _null_ _null_ ginqueryarrayextract - _null_ ));
+DESCR("GIN array support");
DATA(insert OID = 2744 ( ginarrayconsistent PGNSP PGUID 12 1 0 f f t f i 3 16 "2281 21 2281" _null_ _null_ _null_ ginarrayconsistent - _null_ ));
DESCR("GIN array support");
@@ -4128,6 +4139,257 @@ DATA(insert OID = 3529 ( enum_last PGNSP PGUID 12 1 0 f f f f s 1 3500 "3500"
DATA(insert OID = 3530 ( enum_range PGNSP PGUID 12 1 0 f f f f s 2 2277 "3500 3500" _null_ _null_ _null_ enum_range_bounds - _null_ ));
DATA(insert OID = 3531 ( enum_range PGNSP PGUID 12 1 0 f f f f s 1 2277 "3500" _null_ _null_ _null_ enum_range_all - _null_ ));
+/* text search stuff */
+DATA(insert OID = 3610 ( tsvectorin PGNSP PGUID 12 1 0 f f t f i 1 3614 "2275" _null_ _null_ _null_ tsvectorin - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3639 ( tsvectorrecv PGNSP PGUID 12 1 0 f f t f i 1 3614 "2281" _null_ _null_ _null_ tsvectorrecv - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3611 ( tsvectorout PGNSP PGUID 12 1 0 f f t f i 1 2275 "3614" _null_ _null_ _null_ tsvectorout - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3638 ( tsvectorsend PGNSP PGUID 12 1 0 f f t f i 1 17 "3614" _null_ _null_ _null_ tsvectorsend - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3612 ( tsqueryin PGNSP PGUID 12 1 0 f f t f i 1 3615 "2275" _null_ _null_ _null_ tsqueryin - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3641 ( tsqueryrecv PGNSP PGUID 12 1 0 f f t f i 1 3615 "2281" _null_ _null_ _null_ tsqueryrecv - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3613 ( tsqueryout PGNSP PGUID 12 1 0 f f t f i 1 2275 "3615" _null_ _null_ _null_ tsqueryout - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3640 ( tsquerysend PGNSP PGUID 12 1 0 f f t f i 1 17 "3615" _null_ _null_ _null_ tsquerysend - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3646 ( gtsvectorin PGNSP PGUID 12 1 0 f f t f i 1 3642 "2275" _null_ _null_ _null_ gtsvectorin - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3647 ( gtsvectorout PGNSP PGUID 12 1 0 f f t f i 1 2275 "3642" _null_ _null_ _null_ gtsvectorout - _null_ ));
+DESCR("I/O");
+
+DATA(insert OID = 3616 ( tsvector_lt PGNSP PGUID 12 1 0 f f t f i 2 16 "3614 3614" _null_ _null_ _null_ tsvector_lt - _null_ ));
+DESCR("less-than");
+DATA(insert OID = 3617 ( tsvector_le PGNSP PGUID 12 1 0 f f t f i 2 16 "3614 3614" _null_ _null_ _null_ tsvector_le - _null_ ));
+DESCR("less-than-or-equal");
+DATA(insert OID = 3618 ( tsvector_eq PGNSP PGUID 12 1 0 f f t f i 2 16 "3614 3614" _null_ _null_ _null_ tsvector_eq - _null_ ));
+DESCR("equal");
+DATA(insert OID = 3619 ( tsvector_ne PGNSP PGUID 12 1 0 f f t f i 2 16 "3614 3614" _null_ _null_ _null_ tsvector_ne - _null_ ));
+DESCR("not equal");
+DATA(insert OID = 3620 ( tsvector_ge PGNSP PGUID 12 1 0 f f t f i 2 16 "3614 3614" _null_ _null_ _null_ tsvector_ge - _null_ ));
+DESCR("greater-than-or-equal");
+DATA(insert OID = 3621 ( tsvector_gt PGNSP PGUID 12 1 0 f f t f i 2 16 "3614 3614" _null_ _null_ _null_ tsvector_gt - _null_ ));
+DESCR("greater-than");
+DATA(insert OID = 3622 ( tsvector_cmp PGNSP PGUID 12 1 0 f f t f i 2 23 "3614 3614" _null_ _null_ _null_ tsvector_cmp - _null_ ));
+DESCR("btree less-equal-greater");
+
+DATA(insert OID = 3711 ( length PGNSP PGUID 12 1 0 f f t f i 1 23 "3614" _null_ _null_ _null_ tsvector_length - _null_ ));
+DESCR("number of lexemes");
+DATA(insert OID = 3623 ( strip PGNSP PGUID 12 1 0 f f t f i 1 3614 "3614" _null_ _null_ _null_ tsvector_strip - _null_ ));
+DESCR("strip position information");
+DATA(insert OID = 3624 ( setweight PGNSP PGUID 12 1 0 f f t f i 2 3614 "3614 18" _null_ _null_ _null_ tsvector_setweight - _null_ ));
+DESCR("set weight of lexeme's entries");
+DATA(insert OID = 3625 ( tsvector_concat PGNSP PGUID 12 1 0 f f t f i 2 3614 "3614 3614" _null_ _null_ _null_ tsvector_concat - _null_ ));
+DESCR("concatenate");
+
+DATA(insert OID = 3634 ( ts_match_vq PGNSP PGUID 12 1 0 f f t f i 2 16 "3614 3615" _null_ _null_ _null_ ts_match_vq - _null_ ));
+DESCR("match tsvector to tsquery");
+DATA(insert OID = 3635 ( ts_match_qv PGNSP PGUID 12 1 0 f f t f i 2 16 "3615 3614" _null_ _null_ _null_ ts_match_qv - _null_ ));
+DESCR("match tsquery to tsvector");
+DATA(insert OID = 3760 ( ts_match_tt PGNSP PGUID 12 3 0 f f t f s 2 16 "25 25" _null_ _null_ _null_ ts_match_tt - _null_ ));
+DESCR("text search match");
+DATA(insert OID = 3761 ( ts_match_tq PGNSP PGUID 12 2 0 f f t f s 2 16 "25 3615" _null_ _null_ _null_ ts_match_tq - _null_ ));
+DESCR("match text to tsquery");
+
+DATA(insert OID = 3648 ( gtsvector_compress PGNSP PGUID 12 1 0 f f t f i 1 2281 "2281" _null_ _null_ _null_ gtsvector_compress - _null_ ));
+DESCR("GiST tsvector support");
+DATA(insert OID = 3649 ( gtsvector_decompress PGNSP PGUID 12 1 0 f f t f i 1 2281 "2281" _null_ _null_ _null_ gtsvector_decompress - _null_ ));
+DESCR("GiST tsvector support");
+DATA(insert OID = 3650 ( gtsvector_picksplit PGNSP PGUID 12 1 0 f f t f i 2 2281 "2281 2281" _null_ _null_ _null_ gtsvector_picksplit - _null_ ));
+DESCR("GiST tsvector support");
+DATA(insert OID = 3651 ( gtsvector_union PGNSP PGUID 12 1 0 f f t f i 2 2281 "2281 2281" _null_ _null_ _null_ gtsvector_union - _null_ ));
+DESCR("GiST tsvector support");
+DATA(insert OID = 3652 ( gtsvector_same PGNSP PGUID 12 1 0 f f t f i 3 2281 "3642 3642 2281" _null_ _null_ _null_ gtsvector_same - _null_ ));
+DESCR("GiST tsvector support");
+DATA(insert OID = 3653 ( gtsvector_penalty PGNSP PGUID 12 1 0 f f t f i 3 2281 "2281 2281 2281" _null_ _null_ _null_ gtsvector_penalty - _null_ ));
+DESCR("GiST tsvector support");
+DATA(insert OID = 3654 ( gtsvector_consistent PGNSP PGUID 12 1 0 f f t f i 3 16 "3642 2281 23" _null_ _null_ _null_ gtsvector_consistent - _null_ ));
+DESCR("GiST tsvector support");
+
+DATA(insert OID = 3656 ( gin_extract_tsvector PGNSP PGUID 12 1 0 f f t f i 2 2281 "3614 2281" _null_ _null_ _null_ gin_extract_tsvector - _null_ ));
+DESCR("GIN tsvector support");
+DATA(insert OID = 3657 ( gin_extract_query PGNSP PGUID 12 1 0 f f t f i 3 2281 "2281 2281 21" _null_ _null_ _null_ gin_extract_query - _null_ ));
+DESCR("GIN tsvector support");
+DATA(insert OID = 3658 ( gin_ts_consistent PGNSP PGUID 12 1 0 f f t f i 3 16 "2281 21 2281" _null_ _null_ _null_ gin_ts_consistent - _null_ ));
+DESCR("GIN tsvector support");
+
+DATA(insert OID = 3662 ( tsquery_lt PGNSP PGUID 12 1 0 f f t f i 2 16 "3615 3615" _null_ _null_ _null_ tsquery_lt - _null_ ));
+DESCR("less-than");
+DATA(insert OID = 3663 ( tsquery_le PGNSP PGUID 12 1 0 f f t f i 2 16 "3615 3615" _null_ _null_ _null_ tsquery_le - _null_ ));
+DESCR("less-than-or-equal");
+DATA(insert OID = 3664 ( tsquery_eq PGNSP PGUID 12 1 0 f f t f i 2 16 "3615 3615" _null_ _null_ _null_ tsquery_eq - _null_ ));
+DESCR("equal");
+DATA(insert OID = 3665 ( tsquery_ne PGNSP PGUID 12 1 0 f f t f i 2 16 "3615 3615" _null_ _null_ _null_ tsquery_ne - _null_ ));
+DESCR("not equal");
+DATA(insert OID = 3666 ( tsquery_ge PGNSP PGUID 12 1 0 f f t f i 2 16 "3615 3615" _null_ _null_ _null_ tsquery_ge - _null_ ));
+DESCR("greater-than-or-equal");
+DATA(insert OID = 3667 ( tsquery_gt PGNSP PGUID 12 1 0 f f t f i 2 16 "3615 3615" _null_ _null_ _null_ tsquery_gt - _null_ ));
+DESCR("greater-than");
+DATA(insert OID = 3668 ( tsquery_cmp PGNSP PGUID 12 1 0 f f t f i 2 23 "3615 3615" _null_ _null_ _null_ tsquery_cmp - _null_ ));
+DESCR("btree less-equal-greater");
+
+DATA(insert OID = 3669 ( tsquery_and PGNSP PGUID 12 1 0 f f t f i 2 3615 "3615 3615" _null_ _null_ _null_ tsquery_and - _null_ ));
+DESCR("AND-concatenate");
+DATA(insert OID = 3670 ( tsquery_or PGNSP PGUID 12 1 0 f f t f i 2 3615 "3615 3615" _null_ _null_ _null_ tsquery_or - _null_ ));
+DESCR("OR-concatenate");
+DATA(insert OID = 3671 ( tsquery_not PGNSP PGUID 12 1 0 f f t f i 1 3615 "3615" _null_ _null_ _null_ tsquery_not - _null_ ));
+DESCR("NOT-tsquery");
+
+DATA(insert OID = 3691 ( tsq_mcontains PGNSP PGUID 12 1 0 f f t f i 2 16 "3615 3615" _null_ _null_ _null_ tsq_mcontains - _null_ ));
+DESCR("contains");
+DATA(insert OID = 3692 ( tsq_mcontained PGNSP PGUID 12 1 0 f f t f i 2 16 "3615 3615" _null_ _null_ _null_ tsq_mcontained - _null_ ));
+DESCR("contained");
+
+DATA(insert OID = 3672 ( numnode PGNSP PGUID 12 1 0 f f t f i 1 23 "3615" _null_ _null_ _null_ tsquery_numnode - _null_ ));
+DESCR("number of nodes");
+DATA(insert OID = 3673 ( querytree PGNSP PGUID 12 1 0 f f t f i 1 25 "3615" _null_ _null_ _null_ tsquerytree - _null_ ));
+DESCR("show real useful query for GiST index");
+
+DATA(insert OID = 3684 ( ts_rewrite PGNSP PGUID 12 1 0 f f t f i 3 3615 "3615 3615 3615" _null_ _null_ _null_ tsquery_rewrite_query - _null_ ));
+DESCR("rewrite tsquery");
+DATA(insert OID = 3685 ( ts_rewrite PGNSP PGUID 12 1 1000 f f t t v 2 3615 "3615 25" _null_ _null_ _null_ tsquery_rewrite - _null_ ));
+DESCR("rewrite tsquery");
+DATA(insert OID = 3686 ( ts_rewrite_accum PGNSP PGUID 12 1 0 f f f f i 2 3615 "3615 3645" _null_ _null_ _null_ ts_rewrite_accum - _null_ ));
+DESCR("rewrite tsquery accumulator");
+DATA(insert OID = 3687 ( ts_rewrite_finish PGNSP PGUID 12 1 0 f f t f i 1 3615 "3615" _null_ _null_ _null_ ts_rewrite_finish - _null_ ));
+DESCR("rewrite tsquery finish");
+DATA(insert OID = 3688 ( ts_rewrite PGNSP PGUID 12 1 0 t f f f i 1 3615 "3645" _null_ _null_ _null_ aggregate_dummy - _null_ ));
+DESCR("rewrite tsquery");
+
+DATA(insert OID = 3695 ( gtsquery_compress PGNSP PGUID 12 1 0 f f t f i 1 2281 "2281" _null_ _null_ _null_ gtsquery_compress - _null_ ));
+DESCR("GiST tsquery support");
+DATA(insert OID = 3696 ( gtsquery_decompress PGNSP PGUID 12 1 0 f f t f i 1 2281 "2281" _null_ _null_ _null_ gtsquery_decompress - _null_ ));
+DESCR("GiST tsquery support");
+DATA(insert OID = 3697 ( gtsquery_picksplit PGNSP PGUID 12 1 0 f f t f i 2 2281 "2281 2281" _null_ _null_ _null_ gtsquery_picksplit - _null_ ));
+DESCR("GiST tsquery support");
+DATA(insert OID = 3698 ( gtsquery_union PGNSP PGUID 12 1 0 f f t f i 2 2281 "2281 2281" _null_ _null_ _null_ gtsquery_union - _null_ ));
+DESCR("GiST tsquery support");
+DATA(insert OID = 3699 ( gtsquery_same PGNSP PGUID 12 1 0 f f t f i 3 2281 "20 20 2281" _null_ _null_ _null_ gtsquery_same - _null_ ));
+DESCR("GiST tsquery support");
+DATA(insert OID = 3700 ( gtsquery_penalty PGNSP PGUID 12 1 0 f f t f i 3 2281 "2281 2281 2281" _null_ _null_ _null_ gtsquery_penalty - _null_ ));
+DESCR("GiST tsquery support");
+DATA(insert OID = 3701 ( gtsquery_consistent PGNSP PGUID 12 1 0 f f t f i 3 16 "20 2281 23" _null_ _null_ _null_ gtsquery_consistent - _null_ ));
+DESCR("GiST tsquery support");
+
+DATA(insert OID = 3689 ( ts_stat PGNSP PGUID 12 10 10000 f f t t v 1 2249 "25" "{25,25,23,23}" "{i,o,o,o}" "{query,word,ndoc,nentry}" ts_stat1 - _null_ ));
+DESCR("statistics of tsvector column");
+DATA(insert OID = 3690 ( ts_stat PGNSP PGUID 12 10 10000 f f t t v 2 2249 "25 25" "{25,25,25,23,23}" "{i,i,o,o,o}" "{query,weights,word,ndoc,nentry}" ts_stat2 - _null_ ));
+DESCR("statistics of tsvector column");
+
+DATA(insert OID = 3703 ( ts_rank PGNSP PGUID 12 1 0 f f t f i 4 700 "1021 3614 3615 23" _null_ _null_ _null_ ts_rank_wttf - _null_ ));
+DESCR("relevance");
+DATA(insert OID = 3704 ( ts_rank PGNSP PGUID 12 1 0 f f t f i 3 700 "1021 3614 3615" _null_ _null_ _null_ ts_rank_wtt - _null_ ));
+DESCR("relevance");
+DATA(insert OID = 3705 ( ts_rank PGNSP PGUID 12 1 0 f f t f i 3 700 "3614 3615 23" _null_ _null_ _null_ ts_rank_ttf - _null_ ));
+DESCR("relevance");
+DATA(insert OID = 3706 ( ts_rank PGNSP PGUID 12 1 0 f f t f i 2 700 "3614 3615" _null_ _null_ _null_ ts_rank_tt - _null_ ));
+DESCR("relevance");
+DATA(insert OID = 3707 ( ts_rank_cd PGNSP PGUID 12 1 0 f f t f i 4 700 "1021 3614 3615 23" _null_ _null_ _null_ ts_rankcd_wttf - _null_ ));
+DESCR("relevance");
+DATA(insert OID = 3708 ( ts_rank_cd PGNSP PGUID 12 1 0 f f t f i 3 700 "1021 3614 3615" _null_ _null_ _null_ ts_rankcd_wtt - _null_ ));
+DESCR("relevance");
+DATA(insert OID = 3709 ( ts_rank_cd PGNSP PGUID 12 1 0 f f t f i 3 700 "3614 3615 23" _null_ _null_ _null_ ts_rankcd_ttf - _null_ ));
+DESCR("relevance");
+DATA(insert OID = 3710 ( ts_rank_cd PGNSP PGUID 12 1 0 f f t f i 2 700 "3614 3615" _null_ _null_ _null_ ts_rankcd_tt - _null_ ));
+DESCR("relevance");
+
+DATA(insert OID = 3713 ( ts_token_type PGNSP PGUID 12 1 16 f f t t i 1 2249 "26" "{26,23,25,25}" "{i,o,o,o}" "{parser_oid,tokid,alias,description}" ts_token_type_byid - _null_ ));
+DESCR("get parser's token types");
+DATA(insert OID = 3714 ( ts_token_type PGNSP PGUID 12 1 16 f f t t s 1 2249 "25" "{25,23,25,25}" "{i,o,o,o}" "{parser_name,tokid,alias,description}" ts_token_type_byname - _null_ ));
+DESCR("get parser's token types");
+DATA(insert OID = 3715 ( ts_parse PGNSP PGUID 12 1 1000 f f t t i 2 2249 "26 25" "{26,25,23,25}" "{i,i,o,o}" "{parser_oid,txt,tokid,token}" ts_parse_byid - _null_ ));
+DESCR("parse text to tokens");
+DATA(insert OID = 3716 ( ts_parse PGNSP PGUID 12 1 1000 f f t t s 2 2249 "25 25" "{25,25,23,25}" "{i,i,o,o}" "{parser_name,txt,tokid,token}" ts_parse_byname - _null_ ));
+DESCR("parse text to tokens");
+
+DATA(insert OID = 3717 ( prsd_start PGNSP PGUID 12 1 0 f f t f i 2 2281 "2281 23" _null_ _null_ _null_ prsd_start - _null_ ));
+DESCR("");
+DATA(insert OID = 3718 ( prsd_nexttoken PGNSP PGUID 12 1 0 f f t f i 3 2281 "2281 2281 2281" _null_ _null_ _null_ prsd_nexttoken - _null_ ));
+DESCR("");
+DATA(insert OID = 3719 ( prsd_end PGNSP PGUID 12 1 0 f f t f i 1 2278 "2281" _null_ _null_ _null_ prsd_end - _null_ ));
+DESCR("");
+DATA(insert OID = 3720 ( prsd_headline PGNSP PGUID 12 1 0 f f t f i 3 2281 "2281 25 3615" _null_ _null_ _null_ prsd_headline - _null_ ));
+DESCR("");
+DATA(insert OID = 3721 ( prsd_lextype PGNSP PGUID 12 1 0 f f t f i 1 2281 "2281" _null_ _null_ _null_ prsd_lextype - _null_ ));
+DESCR("");
+
+DATA(insert OID = 3723 ( ts_lexize PGNSP PGUID 12 1 0 f f t f i 2 1009 "26 25" _null_ _null_ _null_ ts_lexize_byid - _null_ ));
+DESCR("normalize one word by dictionary");
+DATA(insert OID = 3724 ( ts_lexize PGNSP PGUID 12 1 0 f f t f s 2 1009 "25 25" _null_ _null_ _null_ ts_lexize_byname - _null_ ));
+DESCR("normalize one word by dictionary");
+
+DATA(insert OID = 3725 ( dsimple_init PGNSP PGUID 12 1 0 f f f f i 1 2281 "2281" _null_ _null_ _null_ dsimple_init - _null_ ));
+DESCR("");
+DATA(insert OID = 3726 ( dsimple_lexize PGNSP PGUID 12 1 0 f f t f i 4 2281 "2281 2281 2281 2281" _null_ _null_ _null_ dsimple_lexize - _null_ ));
+DESCR("");
+
+DATA(insert OID = 3728 ( dsynonym_init PGNSP PGUID 12 1 0 f f f f i 1 2281 "2281" _null_ _null_ _null_ dsynonym_init - _null_ ));
+DESCR("");
+DATA(insert OID = 3729 ( dsynonym_lexize PGNSP PGUID 12 1 0 f f t f i 4 2281 "2281 2281 2281 2281" _null_ _null_ _null_ dsynonym_lexize - _null_ ));
+DESCR("");
+
+DATA(insert OID = 3731 ( dispell_init PGNSP PGUID 12 1 0 f f f f i 1 2281 "2281" _null_ _null_ _null_ dispell_init - _null_ ));
+DESCR("");
+DATA(insert OID = 3732 ( dispell_lexize PGNSP PGUID 12 1 0 f f t f i 4 2281 "2281 2281 2281 2281" _null_ _null_ _null_ dispell_lexize - _null_ ));
+DESCR("");
+
+DATA(insert OID = 3740 ( thesaurus_init PGNSP PGUID 12 1 0 f f f f i 1 2281 "2281" _null_ _null_ _null_ thesaurus_init - _null_ ));
+DESCR("");
+DATA(insert OID = 3741 ( thesaurus_lexize PGNSP PGUID 12 1 0 f f t f i 4 2281 "2281 2281 2281 2281" _null_ _null_ _null_ thesaurus_lexize - _null_ ));
+DESCR("");
+
+DATA(insert OID = 3743 ( ts_headline PGNSP PGUID 12 1 0 f f t f i 4 25 "3734 25 3615 25" _null_ _null_ _null_ ts_headline_byid_opt - _null_ ));
+DESCR("generate headline");
+DATA(insert OID = 3744 ( ts_headline PGNSP PGUID 12 1 0 f f t f i 3 25 "3734 25 3615" _null_ _null_ _null_ ts_headline_byid - _null_ ));
+DESCR("generate headline");
+DATA(insert OID = 3754 ( ts_headline PGNSP PGUID 12 1 0 f f t f s 3 25 "25 3615 25" _null_ _null_ _null_ ts_headline_opt - _null_ ));
+DESCR("generate headline");
+DATA(insert OID = 3755 ( ts_headline PGNSP PGUID 12 1 0 f f t f s 2 25 "25 3615" _null_ _null_ _null_ ts_headline - _null_ ));
+DESCR("generate headline");
+
+DATA(insert OID = 3745 ( to_tsvector PGNSP PGUID 12 1 0 f f t f i 2 3614 "3734 25" _null_ _null_ _null_ to_tsvector_byid - _null_ ));
+DESCR("transform to tsvector");
+DATA(insert OID = 3746 ( to_tsquery PGNSP PGUID 12 1 0 f f t f i 2 3615 "3734 25" _null_ _null_ _null_ to_tsquery_byid - _null_ ));
+DESCR("make tsquery");
+DATA(insert OID = 3747 ( plainto_tsquery PGNSP PGUID 12 1 0 f f t f i 2 3615 "3734 25" _null_ _null_ _null_ plainto_tsquery_byid - _null_ ));
+DESCR("transform to tsquery");
+DATA(insert OID = 3749 ( to_tsvector PGNSP PGUID 12 1 0 f f t f s 1 3614 "25" _null_ _null_ _null_ to_tsvector - _null_ ));
+DESCR("transform to tsvector");
+DATA(insert OID = 3750 ( to_tsquery PGNSP PGUID 12 1 0 f f t f s 1 3615 "25" _null_ _null_ _null_ to_tsquery - _null_ ));
+DESCR("make tsquery");
+DATA(insert OID = 3751 ( plainto_tsquery PGNSP PGUID 12 1 0 f f t f s 1 3615 "25" _null_ _null_ _null_ plainto_tsquery - _null_ ));
+DESCR("transform to tsquery");
+
+DATA(insert OID = 3752 ( tsvector_update_trigger PGNSP PGUID 12 1 0 f f f f v 0 2279 "" _null_ _null_ _null_ tsvector_update_trigger_byid - _null_ ));
+DESCR("trigger for automatic update of tsvector column");
+DATA(insert OID = 3753 ( tsvector_update_trigger_column PGNSP PGUID 12 1 0 f f f f v 0 2279 "" _null_ _null_ _null_ tsvector_update_trigger_bycolumn - _null_ ));
+DESCR("trigger for automatic update of tsvector column");
+
+DATA(insert OID = 3759 ( get_current_ts_config PGNSP PGUID 12 1 0 f f t f s 0 3734 "" _null_ _null_ _null_ get_current_ts_config - _null_ ));
+DESCR("get current tsearch configuration");
+
+DATA(insert OID = 3736 ( regconfigin PGNSP PGUID 12 1 0 f f t f s 1 3734 "2275" _null_ _null_ _null_ regconfigin - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3737 ( regconfigout PGNSP PGUID 12 1 0 f f t f s 1 2275 "3734" _null_ _null_ _null_ regconfigout - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3738 ( regconfigrecv PGNSP PGUID 12 1 0 f f t f i 1 3734 "2281" _null_ _null_ _null_ regconfigrecv - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3739 ( regconfigsend PGNSP PGUID 12 1 0 f f t f i 1 17 "3734" _null_ _null_ _null_ regconfigsend - _null_ ));
+DESCR("I/O");
+
+DATA(insert OID = 3771 ( regdictionaryin PGNSP PGUID 12 1 0 f f t f s 1 3769 "2275" _null_ _null_ _null_ regdictionaryin - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3772 ( regdictionaryout PGNSP PGUID 12 1 0 f f t f s 1 2275 "3769" _null_ _null_ _null_ regdictionaryout - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3773 ( regdictionaryrecv PGNSP PGUID 12 1 0 f f t f i 1 3769 "2281" _null_ _null_ _null_ regdictionaryrecv - _null_ ));
+DESCR("I/O");
+DATA(insert OID = 3774 ( regdictionarysend PGNSP PGUID 12 1 0 f f t f i 1 17 "3769" _null_ _null_ _null_ regdictionarysend - _null_ ));
+DESCR("I/O");
+
+
/*
* Symbolic values for provolatile column: these indicate whether the result
* of a function is dependent *only* on the values of its explicit arguments,
diff --git a/src/include/catalog/pg_ts_config.h b/src/include/catalog/pg_ts_config.h
new file mode 100644
index 00000000000..7d56cb39187
--- /dev/null
+++ b/src/include/catalog/pg_ts_config.h
@@ -0,0 +1,65 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_ts_config.h
+ * definition of configuration of tsearch
+ *
+ *
+ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $PostgreSQL: pgsql/src/include/catalog/pg_ts_config.h,v 1.1 2007/08/21 01:11:27 tgl Exp $
+ *
+ * NOTES
+ * the genbki.sh script reads this file and generates .bki
+ * information from the DATA() statements.
+ *
+ * XXX do NOT break up DATA() statements into multiple lines!
+ * the scripts are not as smart as you might think...
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_TS_CONFIG_H
+#define PG_TS_CONFIG_H
+
+/* ----------------
+ * postgres.h contains the system type definitions and the
+ * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
+ * can be read by both genbki.sh and the C compiler.
+ * ----------------
+ */
+
+/* ----------------
+ * pg_ts_config definition. cpp turns this into
+ * typedef struct FormData_pg_ts_config
+ * ----------------
+ */
+#define TSConfigRelationId 3602
+
+CATALOG(pg_ts_config,3602)
+{
+ NameData cfgname; /* name of configuration */
+ Oid cfgnamespace; /* name space */
+ Oid cfgowner; /* owner */
+ Oid cfgparser; /* OID of parser (in pg_ts_parser) */
+} FormData_pg_ts_config;
+
+typedef FormData_pg_ts_config *Form_pg_ts_config;
+
+/* ----------------
+ * compiler constants for pg_ts_config
+ * ----------------
+ */
+#define Natts_pg_ts_config 4
+#define Anum_pg_ts_config_cfgname 1
+#define Anum_pg_ts_config_cfgnamespace 2
+#define Anum_pg_ts_config_cfgowner 3
+#define Anum_pg_ts_config_cfgparser 4
+
+/* ----------------
+ * initial contents of pg_ts_config
+ * ----------------
+ */
+DATA(insert OID = 3748 ( "simple" PGNSP PGUID 3722 ));
+DESCR("simple configuration");
+
+#endif /* PG_TS_CONFIG_H */
diff --git a/src/include/catalog/pg_ts_config_map.h b/src/include/catalog/pg_ts_config_map.h
new file mode 100644
index 00000000000..0db8025110a
--- /dev/null
+++ b/src/include/catalog/pg_ts_config_map.h
@@ -0,0 +1,83 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_ts_config_map.h
+ * definition of token mappings for configurations of tsearch
+ *
+ *
+ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $PostgreSQL: pgsql/src/include/catalog/pg_ts_config_map.h,v 1.1 2007/08/21 01:11:27 tgl Exp $
+ *
+ * NOTES
+ * the genbki.sh script reads this file and generates .bki
+ * information from the DATA() statements.
+ *
+ * XXX do NOT break up DATA() statements into multiple lines!
+ * the scripts are not as smart as you might think...
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_TS_CONFIG_MAP_H
+#define PG_TS_CONFIG_MAP_H
+
+/* ----------------
+ * postgres.h contains the system type definitions and the
+ * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
+ * can be read by both genbki.sh and the C compiler.
+ * ----------------
+ */
+
+/* ----------------
+ * pg_ts_config_map definition. cpp turns this into
+ * typedef struct FormData_pg_ts_config_map
+ * ----------------
+ */
+#define TSConfigMapRelationId 3603
+
+CATALOG(pg_ts_config_map,3603) BKI_WITHOUT_OIDS
+{
+ Oid mapcfg; /* OID of configuration owning this entry */
+ int4 maptokentype; /* token type from parser */
+ int4 mapseqno; /* order in which to consult dictionaries */
+ Oid mapdict; /* dictionary to consult */
+} FormData_pg_ts_config_map;
+
+typedef FormData_pg_ts_config_map *Form_pg_ts_config_map;
+
+/* ----------------
+ * compiler constants for pg_ts_config_map
+ * ----------------
+ */
+#define Natts_pg_ts_config_map 4
+#define Anum_pg_ts_config_map_mapcfg 1
+#define Anum_pg_ts_config_map_maptokentype 2
+#define Anum_pg_ts_config_map_mapseqno 3
+#define Anum_pg_ts_config_map_mapdict 4
+
+/* ----------------
+ * initial contents of pg_ts_config_map
+ * ----------------
+ */
+
+DATA(insert ( 3748 1 1 3765 ));
+DATA(insert ( 3748 2 1 3765 ));
+DATA(insert ( 3748 3 1 3765 ));
+DATA(insert ( 3748 4 1 3765 ));
+DATA(insert ( 3748 5 1 3765 ));
+DATA(insert ( 3748 6 1 3765 ));
+DATA(insert ( 3748 7 1 3765 ));
+DATA(insert ( 3748 8 1 3765 ));
+DATA(insert ( 3748 9 1 3765 ));
+DATA(insert ( 3748 10 1 3765 ));
+DATA(insert ( 3748 11 1 3765 ));
+DATA(insert ( 3748 15 1 3765 ));
+DATA(insert ( 3748 16 1 3765 ));
+DATA(insert ( 3748 17 1 3765 ));
+DATA(insert ( 3748 18 1 3765 ));
+DATA(insert ( 3748 19 1 3765 ));
+DATA(insert ( 3748 20 1 3765 ));
+DATA(insert ( 3748 21 1 3765 ));
+DATA(insert ( 3748 22 1 3765 ));
+
+#endif /* PG_TS_CONFIG_MAP_H */
diff --git a/src/include/catalog/pg_ts_dict.h b/src/include/catalog/pg_ts_dict.h
new file mode 100644
index 00000000000..7c5f07363ee
--- /dev/null
+++ b/src/include/catalog/pg_ts_dict.h
@@ -0,0 +1,68 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_ts_dict.h
+ * definition of dictionaries for tsearch
+ *
+ *
+ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $PostgreSQL: pgsql/src/include/catalog/pg_ts_dict.h,v 1.1 2007/08/21 01:11:27 tgl Exp $
+ *
+ * NOTES
+ * the genbki.sh script reads this file and generates .bki
+ * information from the DATA() statements.
+ *
+ * XXX do NOT break up DATA() statements into multiple lines!
+ * the scripts are not as smart as you might think...
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_TS_DICT_H
+#define PG_TS_DICT_H
+
+/* ----------------
+ * postgres.h contains the system type definitions and the
+ * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
+ * can be read by both genbki.sh and the C compiler.
+ * ----------------
+ */
+
+/* ----------------
+ * pg_ts_dict definition. cpp turns this into
+ * typedef struct FormData_pg_ts_dict
+ * ----------------
+ */
+#define TSDictionaryRelationId 3600
+
+CATALOG(pg_ts_dict,3600)
+{
+ NameData dictname; /* dictionary name */
+ Oid dictnamespace; /* name space */
+ Oid dictowner; /* owner */
+ Oid dicttemplate; /* dictionary's template */
+ text dictinitoption; /* options passed to dict_init() */
+} FormData_pg_ts_dict;
+
+typedef FormData_pg_ts_dict *Form_pg_ts_dict;
+
+/* ----------------
+ * compiler constants for pg_ts_dict
+ * ----------------
+ */
+#define Natts_pg_ts_dict 5
+#define Anum_pg_ts_dict_dictname 1
+#define Anum_pg_ts_dict_dictnamespace 2
+#define Anum_pg_ts_dict_dictowner 3
+#define Anum_pg_ts_dict_dicttemplate 4
+#define Anum_pg_ts_dict_dictinitoption 5
+
+/* ----------------
+ * initial contents of pg_ts_dict
+ * ----------------
+ */
+
+DATA(insert OID = 3765 ( "simple" PGNSP PGUID 3727 _null_));
+DESCR("simple dictionary: just lower case and check for stopword");
+
+#endif /* PG_TS_DICT_H */
diff --git a/src/include/catalog/pg_ts_parser.h b/src/include/catalog/pg_ts_parser.h
new file mode 100644
index 00000000000..fb7aff5b37c
--- /dev/null
+++ b/src/include/catalog/pg_ts_parser.h
@@ -0,0 +1,72 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_ts_parser.h
+ * definition of parsers for tsearch
+ *
+ *
+ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $PostgreSQL: pgsql/src/include/catalog/pg_ts_parser.h,v 1.1 2007/08/21 01:11:27 tgl Exp $
+ *
+ * NOTES
+ * the genbki.sh script reads this file and generates .bki
+ * information from the DATA() statements.
+ *
+ * XXX do NOT break up DATA() statements into multiple lines!
+ * the scripts are not as smart as you might think...
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_TS_PARSER_H
+#define PG_TS_PARSER_H
+
+/* ----------------
+ * postgres.h contains the system type definitions and the
+ * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
+ * can be read by both genbki.sh and the C compiler.
+ * ----------------
+ */
+
+/* ----------------
+ * pg_ts_parser definition. cpp turns this into
+ * typedef struct FormData_pg_ts_parser
+ * ----------------
+ */
+#define TSParserRelationId 3601
+
+CATALOG(pg_ts_parser,3601)
+{
+ NameData prsname; /* parser's name */
+ Oid prsnamespace; /* name space */
+ regproc prsstart; /* init parsing session */
+ regproc prstoken; /* return next token */
+ regproc prsend; /* finalize parsing session */
+ regproc prsheadline; /* return data for headline creation */
+ regproc prslextype; /* return descriptions of lexeme's types */
+} FormData_pg_ts_parser;
+
+typedef FormData_pg_ts_parser *Form_pg_ts_parser;
+
+/* ----------------
+ * compiler constants for pg_ts_parser
+ * ----------------
+ */
+#define Natts_pg_ts_parser 7
+#define Anum_pg_ts_parser_prsname 1
+#define Anum_pg_ts_parser_prsnamespace 2
+#define Anum_pg_ts_parser_prsstart 3
+#define Anum_pg_ts_parser_prstoken 4
+#define Anum_pg_ts_parser_prsend 5
+#define Anum_pg_ts_parser_prsheadline 6
+#define Anum_pg_ts_parser_prslextype 7
+
+/* ----------------
+ * initial contents of pg_ts_parser
+ * ----------------
+ */
+
+DATA(insert OID = 3722 ( "default" PGNSP prsd_start prsd_nexttoken prsd_end prsd_headline prsd_lextype ));
+DESCR("default word parser");
+
+#endif /* PG_TS_PARSER_H */
diff --git a/src/include/catalog/pg_ts_template.h b/src/include/catalog/pg_ts_template.h
new file mode 100644
index 00000000000..9a5c3ef7b71
--- /dev/null
+++ b/src/include/catalog/pg_ts_template.h
@@ -0,0 +1,72 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_ts_template.h
+ * definition of dictionary templates for tsearch
+ *
+ *
+ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $PostgreSQL: pgsql/src/include/catalog/pg_ts_template.h,v 1.1 2007/08/21 01:11:27 tgl Exp $
+ *
+ * NOTES
+ * the genbki.sh script reads this file and generates .bki
+ * information from the DATA() statements.
+ *
+ * XXX do NOT break up DATA() statements into multiple lines!
+ * the scripts are not as smart as you might think...
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_TS_TEMPLATE_H
+#define PG_TS_TEMPLATE_H
+
+/* ----------------
+ * postgres.h contains the system type definitions and the
+ * CATALOG(), BKI_BOOTSTRAP and DATA() sugar words so this file
+ * can be read by both genbki.sh and the C compiler.
+ * ----------------
+ */
+
+/* ----------------
+ * pg_ts_template definition. cpp turns this into
+ * typedef struct FormData_pg_ts_template
+ * ----------------
+ */
+#define TSTemplateRelationId 3764
+
+CATALOG(pg_ts_template,3764)
+{
+ NameData tmplname; /* template name */
+ Oid tmplnamespace; /* name space */
+ regproc tmplinit; /* initialization method of dict (may be 0) */
+ regproc tmpllexize; /* base method of dictionary */
+} FormData_pg_ts_template;
+
+typedef FormData_pg_ts_template *Form_pg_ts_template;
+
+/* ----------------
+ * compiler constants for pg_ts_template
+ * ----------------
+ */
+#define Natts_pg_ts_template 4
+#define Anum_pg_ts_template_tmplname 1
+#define Anum_pg_ts_template_tmplnamespace 2
+#define Anum_pg_ts_template_tmplinit 3
+#define Anum_pg_ts_template_tmpllexize 4
+
+/* ----------------
+ * initial contents of pg_ts_template
+ * ----------------
+ */
+
+DATA(insert OID = 3727 ( "simple" PGNSP dsimple_init dsimple_lexize ));
+DESCR("simple dictionary: just lower case and check for stopword");
+DATA(insert OID = 3730 ( "synonym" PGNSP dsynonym_init dsynonym_lexize ));
+DESCR("synonym dictionary: replace word by its synonym");
+DATA(insert OID = 3733 ( "ispell" PGNSP dispell_init dispell_lexize ));
+DESCR("Ispell dictionary");
+DATA(insert OID = 3742 ( "thesaurus" PGNSP thesaurus_init thesaurus_lexize ));
+DESCR("thesaurus dictionary: phrase by phrase substitution");
+
+#endif /* PG_TS_TEMPLATE_H */
diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h
index 01db6c616fc..6c6715c75a2 100644
--- a/src/include/catalog/pg_type.h
+++ b/src/include/catalog/pg_type.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.186 2007/06/15 20:56:52 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.187 2007/08/21 01:11:27 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -549,6 +549,29 @@ DATA(insert OID = 2950 ( uuid PGNSP PGUID 16 f b t \054 0 0 2951 uuid_in uuid_
DESCR("UUID datatype");
DATA(insert OID = 2951 ( _uuid PGNSP PGUID -1 f b t \054 0 2950 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
+/* text search */
+DATA(insert OID = 3614 ( tsvector PGNSP PGUID -1 f b t \054 0 0 3643 tsvectorin tsvectorout tsvectorrecv tsvectorsend - - - i x f 0 -1 0 _null_ _null_ ));
+DESCR("text representation for text search");
+#define TSVECTOROID 3614
+DATA(insert OID = 3642 ( gtsvector PGNSP PGUID -1 f b t \054 0 0 3644 gtsvectorin gtsvectorout - - - - - i p f 0 -1 0 _null_ _null_ ));
+DESCR("GiST index internal text representation for text search");
+#define GTSVECTOROID 3642
+DATA(insert OID = 3615 ( tsquery PGNSP PGUID -1 f b t \054 0 0 3645 tsqueryin tsqueryout tsqueryrecv tsquerysend - - - i p f 0 -1 0 _null_ _null_ ));
+DESCR("query representation for text search");
+#define TSQUERYOID 3615
+DATA(insert OID = 3734 ( regconfig PGNSP PGUID 4 t b t \054 0 0 3735 regconfigin regconfigout regconfigrecv regconfigsend - - - i p f 0 -1 0 _null_ _null_ ));
+DESCR("registered text search configuration");
+#define REGCONFIGOID 3734
+DATA(insert OID = 3769 ( regdictionary PGNSP PGUID 4 t b t \054 0 0 3770 regdictionaryin regdictionaryout regdictionaryrecv regdictionarysend - - - i p f 0 -1 0 _null_ _null_ ));
+DESCR("registered text search dictionary");
+#define REGDICTIONARYOID 3769
+
+DATA(insert OID = 3643 ( _tsvector PGNSP PGUID -1 f b t \054 0 3614 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
+DATA(insert OID = 3644 ( _gtsvector PGNSP PGUID -1 f b t \054 0 3642 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
+DATA(insert OID = 3645 ( _tsquery PGNSP PGUID -1 f b t \054 0 3615 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
+DATA(insert OID = 3735 ( _regconfig PGNSP PGUID -1 f b t \054 0 3734 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
+DATA(insert OID = 3770 ( _regdictionary PGNSP PGUID -1 f b t \054 0 3769 0 array_in array_out array_recv array_send - - - i x f 0 -1 0 _null_ _null_ ));
+
/*
* pseudo-types
*
diff --git a/src/include/commands/defrem.h b/src/include/commands/defrem.h
index cf74692208b..514507d26f0 100644
--- a/src/include/commands/defrem.h
+++ b/src/include/commands/defrem.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/commands/defrem.h,v 1.82 2007/07/17 05:02:02 neilc Exp $
+ * $PostgreSQL: pgsql/src/include/commands/defrem.h,v 1.83 2007/08/21 01:11:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -92,6 +92,35 @@ extern void RenameOpFamily(List *name, const char *access_method, const char *ne
extern void AlterOpClassOwner(List *name, const char *access_method, Oid newOwnerId);
extern void AlterOpFamilyOwner(List *name, const char *access_method, Oid newOwnerId);
+/* commands/tsearchcmds.c */
+extern void DefineTSParser(List *names, List *parameters);
+extern void RenameTSParser(List *oldname, const char *newname);
+extern void RemoveTSParser(List *names, DropBehavior behavior,
+ bool missing_ok);
+extern void RemoveTSParserById(Oid prsId);
+
+extern void DefineTSDictionary(List *names, List *parameters);
+extern void RenameTSDictionary(List *oldname, const char *newname);
+extern void RemoveTSDictionary(List *names, DropBehavior behavior,
+ bool missing_ok);
+extern void RemoveTSDictionaryById(Oid dictId);
+extern void AlterTSDictionary(AlterTSDictionaryStmt *stmt);
+extern void AlterTSDictionaryOwner(List *name, Oid newOwnerId);
+
+extern void DefineTSTemplate(List *names, List *parameters);
+extern void RenameTSTemplate(List *oldname, const char *newname);
+extern void RemoveTSTemplate(List *names, DropBehavior behavior,
+ bool missing_ok);
+extern void RemoveTSTemplateById(Oid tmplId);
+
+extern void DefineTSConfiguration(List *names, List *parameters);
+extern void RenameTSConfiguration(List *oldname, const char *newname);
+extern void RemoveTSConfiguration(List *names, DropBehavior behavior,
+ bool missing_ok);
+extern void RemoveTSConfigurationById(Oid cfgId);
+extern void AlterTSConfiguration(AlterTSConfigurationStmt *stmt);
+extern void AlterTSConfigurationOwner(List *name, Oid newOwnerId);
+
/* support routines in commands/define.c */
extern char *case_translate_language_name(const char *input);
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index 92bd19e999e..7f6a08f450f 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.202 2007/07/25 12:22:53 mha Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.203 2007/08/21 01:11:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -312,6 +312,8 @@ typedef enum NodeTag
T_ReassignOwnedStmt,
T_CompositeTypeStmt,
T_CreateEnumStmt,
+ T_AlterTSDictionaryStmt,
+ T_AlterTSConfigurationStmt,
/*
* TAGS FOR PARSE TREE NODES (parsenodes.h)
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index a108759b760..7ba810dbb1a 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.350 2007/07/17 05:02:02 neilc Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.351 2007/08/21 01:11:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -836,6 +836,10 @@ typedef enum ObjectType
OBJECT_TABLE,
OBJECT_TABLESPACE,
OBJECT_TRIGGER,
+ OBJECT_TSCONFIGURATION,
+ OBJECT_TSDICTIONARY,
+ OBJECT_TSPARSER,
+ OBJECT_TSTEMPLATE,
OBJECT_TYPE,
OBJECT_VIEW
} ObjectType;
@@ -2033,4 +2037,35 @@ typedef struct ReassignOwnedStmt
char *newrole;
} ReassignOwnedStmt;
+/*
+ * TS Dictionary stmts: DefineStmt, RenameStmt and DropStmt are default
+ */
+typedef struct AlterTSDictionaryStmt
+{
+ NodeTag type;
+ List *dictname; /* qualified name (list of Value strings) */
+ List *options; /* List of DefElem nodes */
+} AlterTSDictionaryStmt;
+
+/*
+ * TS Configuration stmts: DefineStmt, RenameStmt and DropStmt are default
+ */
+typedef struct AlterTSConfigurationStmt
+{
+ NodeTag type;
+ List *cfgname; /* qualified name (list of Value strings) */
+ List *options; /* List of DefElem nodes */
+
+ /*
+ * These fields are used for ADD/ALTER/DROP MAPPING variants.
+ * dicts will be non-NIL if ADD/ALTER MAPPING was specified.
+ * If dicts is NIL, but tokentype isn't, DROP MAPPING was specified.
+ */
+ List *tokentype; /* list of Value strings */
+ List *dicts; /* list of list of Value strings */
+ bool override; /* if true - remove old variant */
+ bool replace; /* if true - replace dictionary by another */
+ bool missing_ok; /* for DROP - skip error if missing? */
+} AlterTSConfigurationStmt;
+
#endif /* PARSENODES_H */
diff --git a/src/include/snowball/header.h b/src/include/snowball/header.h
new file mode 100644
index 00000000000..38b7da73c51
--- /dev/null
+++ b/src/include/snowball/header.h
@@ -0,0 +1,62 @@
+/*-------------------------------------------------------------------------
+ *
+ * header.h
+ * Replacement header file for Snowball stemmer modules
+ *
+ * The Snowball stemmer modules do #include "header.h", and think they
+ * are including snowball/libstemmer/header.h. We adjust the CPPFLAGS
+ * so that this file is found instead, and thereby we can modify the
+ * headers they see. The main point here is to ensure that pg_config.h
+ * is included before any system headers such as <stdio.h>; without that,
+ * we have portability issues on some platforms due to variation in
+ * largefile options across different modules in the backend.
+ *
+ * NOTE: this file should not be included into any non-snowball sources!
+ *
+ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
+ *
+ * $PostgreSQL: pgsql/src/include/snowball/header.h,v 1.1 2007/08/21 01:11:28 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef SNOWBALL_HEADR_H
+#define SNOWBALL_HEADR_H
+
+#include "postgres.h"
+
+/* Some platforms define MAXINT and/or MININT, causing conflicts */
+#ifdef MAXINT
+#undef MAXINT
+#endif
+#ifdef MININT
+#undef MININT
+#endif
+
+/* Now we can include the original Snowball header.h */
+#include "snowball/libstemmer/header.h"
+
+/*
+ * Redefine standard memory allocation interface to pgsql's one.
+ * This allows us to control where the Snowball code allocates stuff.
+ */
+#ifdef malloc
+#undef malloc
+#endif
+#define malloc(a) palloc(a)
+
+#ifdef calloc
+#undef calloc
+#endif
+#define calloc(a,b) palloc0((a) * (b))
+
+#ifdef realloc
+#undef realloc
+#endif
+#define realloc(a,b) repalloc(a,b)
+
+#ifdef free
+#undef free
+#endif
+#define free(a) pfree(a)
+
+#endif /* SNOWBALL_HEADR_H */
diff --git a/src/include/snowball/libstemmer/api.h b/src/include/snowball/libstemmer/api.h
new file mode 100644
index 00000000000..8b997f0c298
--- /dev/null
+++ b/src/include/snowball/libstemmer/api.h
@@ -0,0 +1,26 @@
+
+typedef unsigned char symbol;
+
+/* Or replace 'char' above with 'short' for 16 bit characters.
+
+ More precisely, replace 'char' with whatever type guarantees the
+ character width you need. Note however that sizeof(symbol) should divide
+ HEAD, defined in header.h as 2*sizeof(int), without remainder, otherwise
+ there is an alignment problem. In the unlikely event of a problem here,
+ consult Martin Porter.
+
+*/
+
+struct SN_env {
+ symbol * p;
+ int c; int l; int lb; int bra; int ket;
+ symbol * * S;
+ int * I;
+ unsigned char * B;
+};
+
+extern struct SN_env * SN_create_env(int S_size, int I_size, int B_size);
+extern void SN_close_env(struct SN_env * z, int S_size);
+
+extern int SN_set_current(struct SN_env * z, int size, const symbol * s);
+
diff --git a/src/include/snowball/libstemmer/header.h b/src/include/snowball/libstemmer/header.h
new file mode 100644
index 00000000000..4d3078f50f4
--- /dev/null
+++ b/src/include/snowball/libstemmer/header.h
@@ -0,0 +1,58 @@
+
+#include <limits.h>
+
+#include "api.h"
+
+#define MAXINT INT_MAX
+#define MININT INT_MIN
+
+#define HEAD 2*sizeof(int)
+
+#define SIZE(p) ((int *)(p))[-1]
+#define SET_SIZE(p, n) ((int *)(p))[-1] = n
+#define CAPACITY(p) ((int *)(p))[-2]
+
+struct among
+{ int s_size; /* number of chars in string */
+ const symbol * s; /* search string */
+ int substring_i;/* index to longest matching substring */
+ int result; /* result of the lookup */
+ int (* function)(struct SN_env *);
+};
+
+extern symbol * create_s(void);
+extern void lose_s(symbol * p);
+
+extern int skip_utf8(const symbol * p, int c, int lb, int l, int n);
+
+extern int in_grouping_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
+extern int in_grouping_b_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
+extern int out_grouping_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
+extern int out_grouping_b_U(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
+
+extern int in_grouping(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
+extern int in_grouping_b(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
+extern int out_grouping(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
+extern int out_grouping_b(struct SN_env * z, const unsigned char * s, int min, int max, int repeat);
+
+extern int eq_s(struct SN_env * z, int s_size, const symbol * s);
+extern int eq_s_b(struct SN_env * z, int s_size, const symbol * s);
+extern int eq_v(struct SN_env * z, const symbol * p);
+extern int eq_v_b(struct SN_env * z, const symbol * p);
+
+extern int find_among(struct SN_env * z, const struct among * v, int v_size);
+extern int find_among_b(struct SN_env * z, const struct among * v, int v_size);
+
+extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjustment);
+extern int slice_from_s(struct SN_env * z, int s_size, const symbol * s);
+extern int slice_from_v(struct SN_env * z, const symbol * p);
+extern int slice_del(struct SN_env * z);
+
+extern int insert_s(struct SN_env * z, int bra, int ket, int s_size, const symbol * s);
+extern int insert_v(struct SN_env * z, int bra, int ket, const symbol * p);
+
+extern symbol * slice_to(struct SN_env * z, symbol * p);
+extern symbol * assign_to(struct SN_env * z, symbol * p);
+
+extern void debug(struct SN_env * z, int number, int line_count);
+
diff --git a/src/include/snowball/libstemmer/stem_ISO_8859_1_danish.h b/src/include/snowball/libstemmer/stem_ISO_8859_1_danish.h
new file mode 100644
index 00000000000..49c5559cdfc
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_ISO_8859_1_danish.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * danish_ISO_8859_1_create_env(void);
+extern void danish_ISO_8859_1_close_env(struct SN_env * z);
+
+extern int danish_ISO_8859_1_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_ISO_8859_1_dutch.h b/src/include/snowball/libstemmer/stem_ISO_8859_1_dutch.h
new file mode 100644
index 00000000000..e67d11152cd
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_ISO_8859_1_dutch.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * dutch_ISO_8859_1_create_env(void);
+extern void dutch_ISO_8859_1_close_env(struct SN_env * z);
+
+extern int dutch_ISO_8859_1_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_ISO_8859_1_english.h b/src/include/snowball/libstemmer/stem_ISO_8859_1_english.h
new file mode 100644
index 00000000000..e685dcf7ef0
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_ISO_8859_1_english.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * english_ISO_8859_1_create_env(void);
+extern void english_ISO_8859_1_close_env(struct SN_env * z);
+
+extern int english_ISO_8859_1_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_ISO_8859_1_finnish.h b/src/include/snowball/libstemmer/stem_ISO_8859_1_finnish.h
new file mode 100644
index 00000000000..c67b67b944f
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_ISO_8859_1_finnish.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * finnish_ISO_8859_1_create_env(void);
+extern void finnish_ISO_8859_1_close_env(struct SN_env * z);
+
+extern int finnish_ISO_8859_1_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_ISO_8859_1_french.h b/src/include/snowball/libstemmer/stem_ISO_8859_1_french.h
new file mode 100644
index 00000000000..21244d61621
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_ISO_8859_1_french.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * french_ISO_8859_1_create_env(void);
+extern void french_ISO_8859_1_close_env(struct SN_env * z);
+
+extern int french_ISO_8859_1_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_ISO_8859_1_german.h b/src/include/snowball/libstemmer/stem_ISO_8859_1_german.h
new file mode 100644
index 00000000000..85253892278
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_ISO_8859_1_german.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * german_ISO_8859_1_create_env(void);
+extern void german_ISO_8859_1_close_env(struct SN_env * z);
+
+extern int german_ISO_8859_1_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_ISO_8859_1_hungarian.h b/src/include/snowball/libstemmer/stem_ISO_8859_1_hungarian.h
new file mode 100644
index 00000000000..c3177e5019c
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_ISO_8859_1_hungarian.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * hungarian_ISO_8859_1_create_env(void);
+extern void hungarian_ISO_8859_1_close_env(struct SN_env * z);
+
+extern int hungarian_ISO_8859_1_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_ISO_8859_1_italian.h b/src/include/snowball/libstemmer/stem_ISO_8859_1_italian.h
new file mode 100644
index 00000000000..dccbfd5e971
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_ISO_8859_1_italian.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * italian_ISO_8859_1_create_env(void);
+extern void italian_ISO_8859_1_close_env(struct SN_env * z);
+
+extern int italian_ISO_8859_1_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_ISO_8859_1_norwegian.h b/src/include/snowball/libstemmer/stem_ISO_8859_1_norwegian.h
new file mode 100644
index 00000000000..e09e34e52f3
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_ISO_8859_1_norwegian.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * norwegian_ISO_8859_1_create_env(void);
+extern void norwegian_ISO_8859_1_close_env(struct SN_env * z);
+
+extern int norwegian_ISO_8859_1_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_ISO_8859_1_porter.h b/src/include/snowball/libstemmer/stem_ISO_8859_1_porter.h
new file mode 100644
index 00000000000..5c8fd01db17
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_ISO_8859_1_porter.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * porter_ISO_8859_1_create_env(void);
+extern void porter_ISO_8859_1_close_env(struct SN_env * z);
+
+extern int porter_ISO_8859_1_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_ISO_8859_1_portuguese.h b/src/include/snowball/libstemmer/stem_ISO_8859_1_portuguese.h
new file mode 100644
index 00000000000..0279bc94da6
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_ISO_8859_1_portuguese.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * portuguese_ISO_8859_1_create_env(void);
+extern void portuguese_ISO_8859_1_close_env(struct SN_env * z);
+
+extern int portuguese_ISO_8859_1_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_ISO_8859_1_spanish.h b/src/include/snowball/libstemmer/stem_ISO_8859_1_spanish.h
new file mode 100644
index 00000000000..83f1498403f
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_ISO_8859_1_spanish.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * spanish_ISO_8859_1_create_env(void);
+extern void spanish_ISO_8859_1_close_env(struct SN_env * z);
+
+extern int spanish_ISO_8859_1_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_ISO_8859_1_swedish.h b/src/include/snowball/libstemmer/stem_ISO_8859_1_swedish.h
new file mode 100644
index 00000000000..4184e5ca39e
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_ISO_8859_1_swedish.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * swedish_ISO_8859_1_create_env(void);
+extern void swedish_ISO_8859_1_close_env(struct SN_env * z);
+
+extern int swedish_ISO_8859_1_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_ISO_8859_2_romanian.h b/src/include/snowball/libstemmer/stem_ISO_8859_2_romanian.h
new file mode 100644
index 00000000000..931f269ceb2
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_ISO_8859_2_romanian.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * romanian_ISO_8859_2_create_env(void);
+extern void romanian_ISO_8859_2_close_env(struct SN_env * z);
+
+extern int romanian_ISO_8859_2_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_KOI8_R_russian.h b/src/include/snowball/libstemmer/stem_KOI8_R_russian.h
new file mode 100644
index 00000000000..de2179d29f0
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_KOI8_R_russian.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * russian_KOI8_R_create_env(void);
+extern void russian_KOI8_R_close_env(struct SN_env * z);
+
+extern int russian_KOI8_R_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_danish.h b/src/include/snowball/libstemmer/stem_UTF_8_danish.h
new file mode 100644
index 00000000000..ed744d454f0
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_danish.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * danish_UTF_8_create_env(void);
+extern void danish_UTF_8_close_env(struct SN_env * z);
+
+extern int danish_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_dutch.h b/src/include/snowball/libstemmer/stem_UTF_8_dutch.h
new file mode 100644
index 00000000000..a99646452b0
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_dutch.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * dutch_UTF_8_create_env(void);
+extern void dutch_UTF_8_close_env(struct SN_env * z);
+
+extern int dutch_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_english.h b/src/include/snowball/libstemmer/stem_UTF_8_english.h
new file mode 100644
index 00000000000..619a8bc72ae
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_english.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * english_UTF_8_create_env(void);
+extern void english_UTF_8_close_env(struct SN_env * z);
+
+extern int english_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_finnish.h b/src/include/snowball/libstemmer/stem_UTF_8_finnish.h
new file mode 100644
index 00000000000..d2f2fd96383
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_finnish.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * finnish_UTF_8_create_env(void);
+extern void finnish_UTF_8_close_env(struct SN_env * z);
+
+extern int finnish_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_french.h b/src/include/snowball/libstemmer/stem_UTF_8_french.h
new file mode 100644
index 00000000000..08e341846df
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_french.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * french_UTF_8_create_env(void);
+extern void french_UTF_8_close_env(struct SN_env * z);
+
+extern int french_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_german.h b/src/include/snowball/libstemmer/stem_UTF_8_german.h
new file mode 100644
index 00000000000..5bd84d431f0
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_german.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * german_UTF_8_create_env(void);
+extern void german_UTF_8_close_env(struct SN_env * z);
+
+extern int german_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_hungarian.h b/src/include/snowball/libstemmer/stem_UTF_8_hungarian.h
new file mode 100644
index 00000000000..d81bd23469a
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_hungarian.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * hungarian_UTF_8_create_env(void);
+extern void hungarian_UTF_8_close_env(struct SN_env * z);
+
+extern int hungarian_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_italian.h b/src/include/snowball/libstemmer/stem_UTF_8_italian.h
new file mode 100644
index 00000000000..3bee080d52c
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_italian.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * italian_UTF_8_create_env(void);
+extern void italian_UTF_8_close_env(struct SN_env * z);
+
+extern int italian_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_norwegian.h b/src/include/snowball/libstemmer/stem_UTF_8_norwegian.h
new file mode 100644
index 00000000000..c75444bcd95
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_norwegian.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * norwegian_UTF_8_create_env(void);
+extern void norwegian_UTF_8_close_env(struct SN_env * z);
+
+extern int norwegian_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_porter.h b/src/include/snowball/libstemmer/stem_UTF_8_porter.h
new file mode 100644
index 00000000000..82d469ac459
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_porter.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * porter_UTF_8_create_env(void);
+extern void porter_UTF_8_close_env(struct SN_env * z);
+
+extern int porter_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_portuguese.h b/src/include/snowball/libstemmer/stem_UTF_8_portuguese.h
new file mode 100644
index 00000000000..9fe7f9aa811
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_portuguese.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * portuguese_UTF_8_create_env(void);
+extern void portuguese_UTF_8_close_env(struct SN_env * z);
+
+extern int portuguese_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_romanian.h b/src/include/snowball/libstemmer/stem_UTF_8_romanian.h
new file mode 100644
index 00000000000..d01e8132e20
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_romanian.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * romanian_UTF_8_create_env(void);
+extern void romanian_UTF_8_close_env(struct SN_env * z);
+
+extern int romanian_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_russian.h b/src/include/snowball/libstemmer/stem_UTF_8_russian.h
new file mode 100644
index 00000000000..4ef774ddccb
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_russian.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * russian_UTF_8_create_env(void);
+extern void russian_UTF_8_close_env(struct SN_env * z);
+
+extern int russian_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_spanish.h b/src/include/snowball/libstemmer/stem_UTF_8_spanish.h
new file mode 100644
index 00000000000..10572ecc370
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_spanish.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * spanish_UTF_8_create_env(void);
+extern void spanish_UTF_8_close_env(struct SN_env * z);
+
+extern int spanish_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_swedish.h b/src/include/snowball/libstemmer/stem_UTF_8_swedish.h
new file mode 100644
index 00000000000..1444ebb49a6
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_swedish.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * swedish_UTF_8_create_env(void);
+extern void swedish_UTF_8_close_env(struct SN_env * z);
+
+extern int swedish_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/snowball/libstemmer/stem_UTF_8_turkish.h b/src/include/snowball/libstemmer/stem_UTF_8_turkish.h
new file mode 100644
index 00000000000..8173a174867
--- /dev/null
+++ b/src/include/snowball/libstemmer/stem_UTF_8_turkish.h
@@ -0,0 +1,16 @@
+
+/* This file was generated automatically by the Snowball to ANSI C compiler */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct SN_env * turkish_UTF_8_create_env(void);
+extern void turkish_UTF_8_close_env(struct SN_env * z);
+
+extern int turkish_UTF_8_stem(struct SN_env * z);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/include/tsearch/dicts/regis.h b/src/include/tsearch/dicts/regis.h
new file mode 100644
index 00000000000..d187875168c
--- /dev/null
+++ b/src/include/tsearch/dicts/regis.h
@@ -0,0 +1,49 @@
+/*-------------------------------------------------------------------------
+ *
+ * regis.h
+ *
+ * Declarations for for fast regex subset, used by ISpell
+ *
+ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
+ *
+ * $PostgreSQL: pgsql/src/include/tsearch/dicts/regis.h,v 1.1 2007/08/21 01:11:29 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef __REGIS_H__
+#define __REGIS_H__
+
+typedef struct RegisNode
+{
+ uint32
+ type:2,
+ len:16,
+ unused:14;
+ struct RegisNode *next;
+ unsigned char data[1];
+} RegisNode;
+
+#define RNHDRSZ (offsetof(RegisNode,data))
+
+#define RSF_ONEOF 1
+#define RSF_NONEOF 2
+
+typedef struct Regis
+{
+ RegisNode *node;
+ uint32
+ issuffix:1,
+ nchar:16,
+ unused:15;
+} Regis;
+
+bool RS_isRegis(const char *str);
+
+void RS_compile(Regis * r, bool issuffix, char *str);
+void RS_free(Regis * r);
+
+/*returns true if matches */
+bool RS_execute(Regis * r, char *str);
+
+#endif
diff --git a/src/include/tsearch/dicts/spell.h b/src/include/tsearch/dicts/spell.h
new file mode 100644
index 00000000000..6c15a672f33
--- /dev/null
+++ b/src/include/tsearch/dicts/spell.h
@@ -0,0 +1,153 @@
+/*-------------------------------------------------------------------------
+ *
+ * spell.h
+ *
+ * Declarations for ISpell dictionary
+ *
+ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
+ *
+ * $PostgreSQL: pgsql/src/include/tsearch/dicts/spell.h,v 1.1 2007/08/21 01:11:29 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef __SPELL_H__
+#define __SPELL_H__
+
+#include "regex/regex.h"
+#include "tsearch/dicts/regis.h"
+#include "tsearch/ts_public.h"
+
+struct SPNode;
+
+typedef struct
+{
+ uint32
+ val:8,
+ isword:1,
+ compoundflag:4,
+ affix:19;
+ struct SPNode *node;
+} SPNodeData;
+
+/*
+ * Names of FF_ are correlated with Hunspell options in affix file
+ * http://sourceforge.net/docman/display_doc.php?docid=29374&group_id=143754
+ */
+#define FF_COMPOUNDONLY 0x01
+#define FF_COMPOUNDBEGIN 0x02
+#define FF_COMPOUNDMIDDLE 0x04
+#define FF_COMPOUNDLAST 0x08
+#define FF_COMPOUNDFLAG ( FF_COMPOUNDBEGIN | FF_COMPOUNDMIDDLE | FF_COMPOUNDLAST )
+#define FF_DICTFLAGMASK 0x0f
+
+typedef struct SPNode
+{
+ uint32 length;
+ SPNodeData data[1];
+} SPNode;
+
+#define SPNHRDSZ (sizeof(uint32))
+
+
+typedef struct spell_struct
+{
+ union
+ {
+ char flag[16];
+ struct
+ {
+ int affix;
+ int len;
+ } d;
+ } p;
+ char word[1];
+} SPELL;
+
+#define SPELLHDRSZ (offsetof(SPELL, word))
+
+typedef struct aff_struct
+{
+ uint32
+ flag:8,
+ type:1,
+ flagflags:7,
+ issimple:1,
+ isregis:1,
+ replen:14;
+ char *find;
+ char *repl;
+ union
+ {
+ regex_t regex;
+ Regis regis;
+ } reg;
+} AFFIX;
+
+/*
+ * affixes use deictinary flags too
+ */
+#define FF_COMPOUNDPERMITFLAG 0x10
+#define FF_COMPOUNDFORBIDFLAG 0x20
+#define FF_CROSSPRODUCT 0x40
+#define FF_SUFFIX 1
+#define FF_PREFIX 0
+
+struct AffixNode;
+
+typedef struct
+{
+ uint32
+ val:8,
+ naff:24;
+ AFFIX **aff;
+ struct AffixNode *node;
+} AffixNodeData;
+
+typedef struct AffixNode
+{
+ uint32 isvoid:1,
+ length:31;
+ AffixNodeData data[1];
+} AffixNode;
+
+#define ANHRDSZ (sizeof(uint32))
+
+typedef struct
+{
+ char *affix;
+ int len;
+ bool issuffix;
+} CMPDAffix;
+
+typedef struct
+{
+ int maffixes;
+ int naffixes;
+ AFFIX *Affix;
+
+ int nspell;
+ int mspell;
+ SPELL **Spell;
+
+ AffixNode *Suffix;
+ AffixNode *Prefix;
+
+ SPNode *Dictionary;
+ char **AffixData;
+ int lenAffixData;
+ int nAffixData;
+
+ CMPDAffix *CompoundAffix;
+
+ unsigned char flagval[256];
+ bool usecompound;
+} IspellDict;
+
+extern TSLexeme *NINormalizeWord(IspellDict * Conf, char *word);
+extern void NIImportAffixes(IspellDict * Conf, const char *filename);
+extern void NIImportDictionary(IspellDict * Conf, const char *filename);
+extern void NISortDictionary(IspellDict * Conf);
+extern void NISortAffixes(IspellDict * Conf);
+
+#endif
diff --git a/src/include/tsearch/ts_cache.h b/src/include/tsearch/ts_cache.h
new file mode 100644
index 00000000000..ac309f8c324
--- /dev/null
+++ b/src/include/tsearch/ts_cache.h
@@ -0,0 +1,98 @@
+/*-------------------------------------------------------------------------
+ *
+ * ts_cache.h
+ * Tsearch related object caches.
+ *
+ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $PostgreSQL: pgsql/src/include/tsearch/ts_cache.h,v 1.1 2007/08/21 01:11:29 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef TS_CACHE_H
+#define TS_CACHE_H
+
+#include "fmgr.h"
+#include "utils/guc.h"
+
+
+/*
+ * All TS*CacheEntry structs must share this common header
+ * (see InvalidateTSCacheCallBack)
+ */
+typedef struct TSAnyCacheEntry
+{
+ Oid objId;
+ bool isvalid;
+} TSAnyCacheEntry;
+
+
+typedef struct TSParserCacheEntry
+{
+ /* prsId is the hash lookup key and MUST BE FIRST */
+ Oid prsId; /* OID of the parser */
+ bool isvalid;
+
+ Oid startOid;
+ Oid tokenOid;
+ Oid endOid;
+ Oid headlineOid;
+ Oid lextypeOid;
+
+ /*
+ * Pre-set-up fmgr call of most needed parser's methods
+ */
+ FmgrInfo prsstart;
+ FmgrInfo prstoken;
+ FmgrInfo prsend;
+ FmgrInfo prsheadline;
+} TSParserCacheEntry;
+
+typedef struct TSDictionaryCacheEntry
+{
+ /* dictId is the hash lookup key and MUST BE FIRST */
+ Oid dictId;
+ bool isvalid;
+
+ /* most frequent fmgr call */
+ Oid lexizeOid;
+ FmgrInfo lexize;
+
+ MemoryContext dictCtx; /* memory context to store private data */
+ void *dictData;
+} TSDictionaryCacheEntry;
+
+typedef struct
+{
+ int len;
+ Oid *dictIds;
+} ListDictionary;
+
+typedef struct
+{
+ /* cfgId is the hash lookup key and MUST BE FIRST */
+ Oid cfgId;
+ bool isvalid;
+
+ Oid prsId;
+
+ int lenmap;
+ ListDictionary *map;
+} TSConfigCacheEntry;
+
+
+/*
+ * GUC variable for current configuration
+ */
+extern char *TSCurrentConfig;
+
+
+extern TSParserCacheEntry *lookup_ts_parser_cache(Oid prsId);
+extern TSDictionaryCacheEntry *lookup_ts_dictionary_cache(Oid dictId);
+extern TSConfigCacheEntry *lookup_ts_config_cache(Oid cfgId);
+
+extern Oid getTSCurrentConfig(bool emitError);
+extern const char *assignTSCurrentConfig(const char *newval, bool doit, GucSource source);
+
+#endif /* TS_CACHE_H */
diff --git a/src/include/tsearch/ts_locale.h b/src/include/tsearch/ts_locale.h
new file mode 100644
index 00000000000..8a197666473
--- /dev/null
+++ b/src/include/tsearch/ts_locale.h
@@ -0,0 +1,88 @@
+/*-------------------------------------------------------------------------
+ *
+ * ts_locale.h
+ * helper utilities for tsearch
+ *
+ * Copyright (c) 1998-2007, PostgreSQL Global Development Group
+ *
+ * $PostgreSQL: pgsql/src/include/tsearch/ts_locale.h,v 1.1 2007/08/21 01:11:29 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef __TSLOCALE_H__
+#define __TSLOCALE_H__
+
+#include <ctype.h>
+#include <limits.h>
+
+#include "utils/pg_locale.h"
+#include "mb/pg_wchar.h"
+
+/*
+ * towlower() and friends should be in <wctype.h>, but some pre-C99 systems
+ * declare them in <wchar.h>.
+ */
+#ifdef HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+#ifdef HAVE_WCTYPE_H
+#include <wctype.h>
+#endif
+
+#if defined(HAVE_WCSTOMBS) && defined(HAVE_TOWLOWER)
+#define TS_USE_WIDE
+#endif
+
+#define TOUCHAR(x) (*((unsigned char*)(x)))
+
+#ifdef TS_USE_WIDE
+
+size_t char2wchar(wchar_t *to, const char *from, size_t len);
+
+#ifdef WIN32
+
+size_t wchar2char(char *to, const wchar_t *from, size_t len);
+#else /* WIN32 */
+
+/* correct wcstombs */
+#define wchar2char wcstombs
+
+#endif /* WIN32 */
+
+#define t_isdigit(x) ( pg_mblen(x)==1 && isdigit( TOUCHAR(x) ) )
+#define t_isspace(x) ( pg_mblen(x)==1 && isspace( TOUCHAR(x) ) )
+extern int _t_isalpha(const char *ptr);
+
+#define t_isalpha(x) ( (pg_mblen(x)==1) ? isalpha( TOUCHAR(x) ) : _t_isalpha(x) )
+extern int _t_isprint(const char *ptr);
+
+#define t_isprint(x) ( (pg_mblen(x)==1) ? isprint( TOUCHAR(x) ) : _t_isprint(x) )
+/*
+ * t_iseq() should be called only for ASCII symbols
+ */
+#define t_iseq(x,c) ( (pg_mblen(x)==1) ? ( TOUCHAR(x) == ((unsigned char)(c)) ) : false )
+
+#define COPYCHAR(d,s) do { \
+ int lll = pg_mblen( s ); \
+ \
+ while( lll-- ) \
+ TOUCHAR((d)+lll) = TOUCHAR((s)+lll); \
+} while(0)
+
+#else /* not def TS_USE_WIDE */
+
+#define t_isdigit(x) isdigit( TOUCHAR(x) )
+#define t_isspace(x) isspace( TOUCHAR(x) )
+#define t_isalpha(x) isalpha( TOUCHAR(x) )
+#define t_isprint(x) isprint( TOUCHAR(x) )
+#define t_iseq(x,c) ( TOUCHAR(x) == ((unsigned char)(c)) )
+
+#define COPYCHAR(d,s) TOUCHAR(d) = TOUCHAR(s)
+#endif
+
+char *lowerstr(char *str);
+char *lowerstr_with_len(char *str, int len);
+char *recode_and_lowerstr(char *str);
+
+#endif /* __TSLOCALE_H__ */
diff --git a/src/include/tsearch/ts_public.h b/src/include/tsearch/ts_public.h
new file mode 100644
index 00000000000..8e8fa5cc6ff
--- /dev/null
+++ b/src/include/tsearch/ts_public.h
@@ -0,0 +1,128 @@
+/*-------------------------------------------------------------------------
+ *
+ * ts_public.h
+ * Public interface to various tsearch modules, such as
+ * parsers and dictionaries.
+ *
+ * Copyright (c) 1998-2007, PostgreSQL Global Development Group
+ *
+ * $PostgreSQL: pgsql/src/include/tsearch/ts_public.h,v 1.1 2007/08/21 01:11:29 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef _PG_TS_PUBLIC_H_
+#define _PG_TS_PUBLIC_H_
+
+#include "tsearch/ts_type.h"
+
+/*
+ * Parser's framework
+ */
+
+/*
+ * returning type for prslextype method of parser
+ */
+typedef struct
+{
+ int lexid;
+ char *alias;
+ char *descr;
+} LexDescr;
+
+/*
+ * Interface to headline generator
+ */
+typedef struct
+{
+ uint32 selected:1,
+ in:1,
+ replace:1,
+ repeated:1,
+ unused:4,
+ type:8,
+ len:16;
+ char *word;
+ QueryItem *item;
+} HeadlineWordEntry;
+
+typedef struct
+{
+ HeadlineWordEntry *words;
+ int4 lenwords;
+ int4 curwords;
+ char *startsel;
+ char *stopsel;
+ int2 startsellen;
+ int2 stopsellen;
+} HeadlineParsedText;
+
+/*
+ * Common useful things for tsearch subsystem
+ */
+
+/* simple parser of cfg string looking like "key=val, key='val'" */
+typedef struct
+{
+ char *key;
+ char *value;
+} Map;
+
+extern void parse_keyvalpairs(text *in, Map ** m);
+
+extern char *get_tsearch_config_filename(const char *basename,
+ const char *extension);
+
+extern char *pnstrdup(const char *in, int len);
+
+/*
+ * Often useful stopword list management
+ */
+typedef struct
+{
+ int len;
+ char **stop;
+ char *(*wordop) (char *);
+} StopList;
+
+extern void sortstoplist(StopList * s);
+extern void readstoplist(char *in, StopList * s);
+extern bool searchstoplist(StopList * s, char *key);
+
+/*
+ * Interface with dictionaries
+ */
+
+/* return struct for any lexize function */
+typedef struct
+{
+ /*
+ * number of variant of split word , for example Word 'fotballklubber'
+ * (norwegian) has two varian to split: ( fotball, klubb ) and ( fot,
+ * ball, klubb ). So, dictionary should return: nvariant lexeme 1 fotball
+ * 1 klubb 2 fot 2 ball 2 klubb
+ */
+ uint16 nvariant;
+
+ uint16 flags;
+
+ /* C-string */
+ char *lexeme;
+} TSLexeme;
+
+#define TSL_ADDPOS 0x01
+
+/*
+ * Struct for supporting complex dictionaries like
+ * thesaurus, pointer to is an 4-th argument for
+ * dictlexize method
+ */
+typedef struct
+{
+ bool isend; /* in: marks for lexize_info about text end is
+ * reached */
+ bool getnext; /* out: dict wants next lexeme */
+ void *private; /* internal dict state between calls with
+ * getnext == true */
+} DictSubState;
+
+#endif /* _PG_TS_PUBLIC_H_ */
diff --git a/src/include/tsearch/ts_type.h b/src/include/tsearch/ts_type.h
new file mode 100644
index 00000000000..ec22f96f59f
--- /dev/null
+++ b/src/include/tsearch/ts_type.h
@@ -0,0 +1,240 @@
+/*-------------------------------------------------------------------------
+ *
+ * ts_type.h
+ * Definitions for the tsvector and tsquery types
+ *
+ * Copyright (c) 1998-2007, PostgreSQL Global Development Group
+ *
+ * $PostgreSQL: pgsql/src/include/tsearch/ts_type.h,v 1.1 2007/08/21 01:11:29 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef _PG_TSTYPE_H_
+#define _PG_TSTYPE_H_
+
+#include "fmgr.h"
+
+/*
+ * TSVector type.
+ * Note, tsvectorsend/recv believe that sizeof(WordEntry) == 4
+ */
+
+typedef struct
+{
+ uint32
+ haspos:1,
+ len:11, /* MAX 2Kb */
+ pos:20; /* MAX 1Mb */
+} WordEntry;
+
+#define MAXSTRLEN ( 1<<11 )
+#define MAXSTRPOS ( 1<<20 )
+
+/*
+ * Equivalent to
+ * typedef struct {
+ * uint16
+ * weight:2,
+ * pos:14;
+ * }
+ */
+
+typedef uint16 WordEntryPos;
+
+#define WEP_GETWEIGHT(x) ( (x) >> 14 )
+#define WEP_GETPOS(x) ( (x) & 0x3fff )
+
+#define WEP_SETWEIGHT(x,v) ( (x) = ( (v) << 14 ) | ( (x) & 0x3fff ) )
+#define WEP_SETPOS(x,v) ( (x) = ( (x) & 0xc000 ) | ( (v) & 0x3fff ) )
+
+#define MAXENTRYPOS (1<<14)
+#define MAXNUMPOS (256)
+#define LIMITPOS(x) ( ( (x) >= MAXENTRYPOS ) ? (MAXENTRYPOS-1) : (x) )
+
+/*
+ * Structure of tsvector datatype:
+ * 1) standard varlena header
+ * 2) int4 size - number of lexemes or WordEntry array, which is the same
+ * 3) Array of WordEntry - sorted array, comparison based on word's length
+ * and strncmp(). WordEntry->pos points number of
+ * bytes from end of WordEntry array to start of
+ * corresponding lexeme.
+ * 4) Lexeme's storage:
+ * SHORTALIGNED(lexeme) and position information if it exists
+ * Position information: first int2 - is a number of positions and it
+ * follows array of WordEntryPos
+ */
+
+typedef struct
+{
+ int32 vl_len_; /* varlena header (do not touch directly!) */
+ int4 size;
+ char data[1];
+} TSVectorData;
+
+typedef TSVectorData *TSVector;
+
+#define DATAHDRSIZE (VARHDRSZ + sizeof(int4))
+#define CALCDATASIZE(x, lenstr) ( (x) * sizeof(WordEntry) + DATAHDRSIZE + (lenstr) )
+#define ARRPTR(x) ( (WordEntry*) ( (char*)(x) + DATAHDRSIZE ) )
+#define STRPTR(x) ( (char*)(x) + DATAHDRSIZE + ( sizeof(WordEntry) * ((TSVector)(x))->size ) )
+#define STRSIZE(x) ( ((TSVector)(x))->len - DATAHDRSIZE - ( sizeof(WordEntry) * ((TSVector)(x))->size ) )
+#define _POSDATAPTR(x,e) (STRPTR(x)+((WordEntry*)(e))->pos+SHORTALIGN(((WordEntry*)(e))->len))
+#define POSDATALEN(x,e) ( ( ((WordEntry*)(e))->haspos ) ? (*(uint16*)_POSDATAPTR(x,e)) : 0 )
+#define POSDATAPTR(x,e) ( (WordEntryPos*)( _POSDATAPTR(x,e)+sizeof(uint16) ) )
+
+/*
+ * fmgr interface macros
+ */
+
+#define DatumGetTSVector(X) ((TSVector) PG_DETOAST_DATUM(X))
+#define DatumGetTSVectorCopy(X) ((TSVector) PG_DETOAST_DATUM_COPY(X))
+#define TSVectorGetDatum(X) PointerGetDatum(X)
+#define PG_GETARG_TSVECTOR(n) DatumGetTSVector(PG_GETARG_DATUM(n))
+#define PG_GETARG_TSVECTOR_COPY(n) DatumGetTSVectorCopy(PG_GETARG_DATUM(n))
+#define PG_RETURN_TSVECTOR(x) return TSVectorGetDatum(x)
+
+/*
+ * I/O
+ */
+extern Datum tsvectorin(PG_FUNCTION_ARGS);
+extern Datum tsvectorout(PG_FUNCTION_ARGS);
+extern Datum tsvectorsend(PG_FUNCTION_ARGS);
+extern Datum tsvectorrecv(PG_FUNCTION_ARGS);
+
+/*
+ * operations with tsvector
+ */
+extern Datum tsvector_lt(PG_FUNCTION_ARGS);
+extern Datum tsvector_le(PG_FUNCTION_ARGS);
+extern Datum tsvector_eq(PG_FUNCTION_ARGS);
+extern Datum tsvector_ne(PG_FUNCTION_ARGS);
+extern Datum tsvector_ge(PG_FUNCTION_ARGS);
+extern Datum tsvector_gt(PG_FUNCTION_ARGS);
+extern Datum tsvector_cmp(PG_FUNCTION_ARGS);
+
+extern Datum tsvector_length(PG_FUNCTION_ARGS);
+extern Datum tsvector_strip(PG_FUNCTION_ARGS);
+extern Datum tsvector_setweight(PG_FUNCTION_ARGS);
+extern Datum tsvector_concat(PG_FUNCTION_ARGS);
+extern Datum tsvector_update_trigger_byid(PG_FUNCTION_ARGS);
+extern Datum tsvector_update_trigger_bycolumn(PG_FUNCTION_ARGS);
+
+extern Datum ts_match_vq(PG_FUNCTION_ARGS);
+extern Datum ts_match_qv(PG_FUNCTION_ARGS);
+extern Datum ts_match_tt(PG_FUNCTION_ARGS);
+extern Datum ts_match_tq(PG_FUNCTION_ARGS);
+
+extern Datum ts_stat1(PG_FUNCTION_ARGS);
+extern Datum ts_stat2(PG_FUNCTION_ARGS);
+
+extern Datum ts_rank_tt(PG_FUNCTION_ARGS);
+extern Datum ts_rank_wtt(PG_FUNCTION_ARGS);
+extern Datum ts_rank_ttf(PG_FUNCTION_ARGS);
+extern Datum ts_rank_wttf(PG_FUNCTION_ARGS);
+extern Datum ts_rankcd_tt(PG_FUNCTION_ARGS);
+extern Datum ts_rankcd_wtt(PG_FUNCTION_ARGS);
+extern Datum ts_rankcd_ttf(PG_FUNCTION_ARGS);
+extern Datum ts_rankcd_wttf(PG_FUNCTION_ARGS);
+
+
+/*
+ * TSQuery
+ */
+
+/*
+ * QueryItem is one node in tsquery - operator or operand.
+ */
+
+typedef struct QueryItem
+{
+ int8 type; /* operand or kind of operator */
+ int8 weight; /* weights of operand to search */
+ int2 left; /* pointer to left operand Right operand is
+ * item + 1, left operand is placed
+ * item+item->left */
+ int4 val; /* crc32 value of operand's value */
+ /* pointer to text value of operand, must correlate with WordEntry */
+ uint32
+ istrue:1, /* use for ranking in Cover */
+ length:11,
+ distance:20;
+} QueryItem;
+
+/*
+ * It's impossible to use offsetof(QueryItem, istrue)
+ */
+#define HDRSIZEQI ( sizeof(int8) + sizeof(int8) + sizeof(int2) + sizeof(int4) )
+
+/*
+ * Storage:
+ * (len)(size)(array of ITEM)(array of operand in text form)
+ * operands are always finished by '\0'
+ */
+
+typedef struct
+{
+ int32 vl_len_; /* varlena header (do not touch directly!) */
+ int4 size; /* number of QueryItems */
+ char data[1];
+} TSQueryData;
+
+typedef TSQueryData *TSQuery;
+
+#define HDRSIZETQ ( VARHDRSZ + sizeof(int4) )
+#define COMPUTESIZE(size,lenofoperand) ( HDRSIZETQ + (size) * sizeof(QueryItem) + (lenofoperand) )
+#define GETQUERY(x) ((QueryItem*)( (char*)(x)+HDRSIZETQ ))
+#define GETOPERAND(x) ( (char*)GETQUERY(x) + ((TSQuery)(x))->size * sizeof(QueryItem) )
+#define OPERANDSSIZE(x) ( (x)->len - HDRSIZETQ - (x)->size * sizeof(QueryItem) )
+
+#define ISOPERATOR(x) ( pg_mblen(x)==1 && ( *(x)=='!' || *(x)=='&' || *(x)=='|' || *(x)=='(' || *(x)==')' ) )
+
+
+/*
+ * fmgr interface macros
+ * Note, TSQuery type marked as plain storage, so it can't be toasted
+ * but PG_DETOAST_DATUM_COPY is used for simplicity
+ */
+
+#define DatumGetTSQuery(X) ((TSQuery) DatumGetPointer(X))
+#define DatumGetTSQueryCopy(X) ((TSQuery) PG_DETOAST_DATUM_COPY(X))
+#define TSQueryGetDatum(X) PointerGetDatum(X)
+#define PG_GETARG_TSQUERY(n) DatumGetTSQuery(PG_GETARG_DATUM(n))
+#define PG_GETARG_TSQUERY_COPY(n) DatumGetTSQueryCopy(PG_GETARG_DATUM(n))
+#define PG_RETURN_TSQUERY(x) return TSQueryGetDatum(x)
+
+/*
+ * I/O
+ */
+extern Datum tsqueryin(PG_FUNCTION_ARGS);
+extern Datum tsqueryout(PG_FUNCTION_ARGS);
+extern Datum tsquerysend(PG_FUNCTION_ARGS);
+extern Datum tsqueryrecv(PG_FUNCTION_ARGS);
+
+/*
+ * operations with tsquery
+ */
+extern Datum tsquery_lt(PG_FUNCTION_ARGS);
+extern Datum tsquery_le(PG_FUNCTION_ARGS);
+extern Datum tsquery_eq(PG_FUNCTION_ARGS);
+extern Datum tsquery_ne(PG_FUNCTION_ARGS);
+extern Datum tsquery_ge(PG_FUNCTION_ARGS);
+extern Datum tsquery_gt(PG_FUNCTION_ARGS);
+extern Datum tsquery_cmp(PG_FUNCTION_ARGS);
+
+extern Datum tsquerytree(PG_FUNCTION_ARGS);
+extern Datum tsquery_numnode(PG_FUNCTION_ARGS);
+
+extern Datum tsquery_and(PG_FUNCTION_ARGS);
+extern Datum tsquery_or(PG_FUNCTION_ARGS);
+extern Datum tsquery_not(PG_FUNCTION_ARGS);
+
+extern Datum tsquery_rewrite(PG_FUNCTION_ARGS);
+extern Datum tsquery_rewrite_query(PG_FUNCTION_ARGS);
+extern Datum ts_rewrite_accum(PG_FUNCTION_ARGS);
+extern Datum ts_rewrite_finish(PG_FUNCTION_ARGS);
+
+extern Datum tsq_mcontains(PG_FUNCTION_ARGS);
+extern Datum tsq_mcontained(PG_FUNCTION_ARGS);
+
+#endif /* _PG_TSTYPE_H_ */
diff --git a/src/include/tsearch/ts_utils.h b/src/include/tsearch/ts_utils.h
new file mode 100644
index 00000000000..f84db4c6e41
--- /dev/null
+++ b/src/include/tsearch/ts_utils.h
@@ -0,0 +1,315 @@
+/*-------------------------------------------------------------------------
+ *
+ * ts_utils.h
+ * helper utilities for tsearch
+ *
+ * Copyright (c) 1998-2007, PostgreSQL Global Development Group
+ *
+ * $PostgreSQL: pgsql/src/include/tsearch/ts_utils.h,v 1.1 2007/08/21 01:11:29 tgl Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef _PG_TS_UTILS_H_
+#define _PG_TS_UTILS_H_
+
+#include "tsearch/ts_type.h"
+
+/*
+ * Common parse definitions for tsvector and tsquery
+ */
+
+typedef struct
+{
+ WordEntry entry; /* should be first ! */
+ WordEntryPos *pos;
+} WordEntryIN;
+
+typedef struct
+{
+ char *prsbuf;
+ char *word;
+ char *curpos;
+ int4 len;
+ int4 state;
+ int4 alen;
+ WordEntryPos *pos;
+ bool oprisdelim;
+} TSVectorParseState;
+
+extern bool gettoken_tsvector(TSVectorParseState *state);
+
+struct ParseQueryNode;
+typedef struct
+{
+ char *buffer; /* entire string we are scanning */
+ char *buf; /* current scan point */
+ int4 state;
+ int4 count;
+
+ /* reverse polish notation in list (for temprorary usage) */
+ struct ParseQueryNode *str;
+
+ /* number in str */
+ int4 num;
+
+ /* text-form operand */
+ int4 lenop;
+ int4 sumlen;
+ char *op;
+ char *curop;
+
+ /* state for value's parser */
+ TSVectorParseState valstate;
+ /* tscfg */
+ Oid cfg_id;
+} TSQueryParserState;
+
+extern TSQuery parse_tsquery(char *buf,
+ void (*pushval) (TSQueryParserState *, int, char *, int, int2),
+ Oid cfg_id, bool isplain);
+extern void pushval_asis(TSQueryParserState * state,
+ int type, char *strval, int lenval, int2 weight);
+extern void pushquery(TSQueryParserState * state, int4 type, int4 val,
+ int4 distance, int4 lenval, int2 weight);
+
+/*
+ * parse plain text and lexize words
+ */
+typedef struct
+{
+ uint16 len;
+ uint16 nvariant;
+ union
+ {
+ uint16 pos;
+ uint16 *apos;
+ } pos;
+ char *word;
+ uint32 alen;
+} ParsedWord;
+
+typedef struct
+{
+ ParsedWord *words;
+ int4 lenwords;
+ int4 curwords;
+ int4 pos;
+} ParsedText;
+
+extern void parsetext(Oid cfgId, ParsedText * prs, char *buf, int4 buflen);
+
+/*
+ * headline framework, flow in common to generate:
+ * 1 parse text with hlparsetext
+ * 2 parser-specific function to find part
+ * 3 generatHeadline to generate result text
+ */
+
+typedef struct
+{
+ uint32 selected:1,
+ in:1,
+ replace:1,
+ repeated:1,
+ unused:4,
+ type:8,
+ len:16;
+ char *word;
+ QueryItem *item;
+} HeadlineWord;
+
+typedef struct
+{
+ HeadlineWord *words;
+ int4 lenwords;
+ int4 curwords;
+ char *startsel;
+ char *stopsel;
+ int2 startsellen;
+ int2 stopsellen;
+} HeadlineText;
+
+extern void hlparsetext(Oid cfgId, HeadlineText * prs, TSQuery query,
+ char *buf, int4 buflen);
+extern text *generatHeadline(HeadlineText * prs);
+
+/*
+ * token/node types for parsing
+ */
+#define END 0
+#define ERR 1
+#define VAL 2
+#define OPR 3
+#define OPEN 4
+#define CLOSE 5
+#define VALSTOP 6 /* for stop words */
+
+/*
+ * Common check function for tsvector @@ tsquery
+ */
+
+extern bool TS_execute(QueryItem * curitem, void *checkval, bool calcnot,
+ bool (*chkcond) (void *checkval, QueryItem * val));
+
+/*
+ * Useful conversion macros
+ */
+#define TextPGetCString(t) DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(t)))
+#define CStringGetTextP(c) DatumGetTextP(DirectFunctionCall1(textin, CStringGetDatum(c)))
+
+/*
+ * to_ts* - text transformation to tsvector, tsquery
+ */
+extern TSVector make_tsvector(ParsedText *prs);
+
+extern Datum to_tsvector_byid(PG_FUNCTION_ARGS);
+extern Datum to_tsvector(PG_FUNCTION_ARGS);
+extern Datum to_tsquery_byid(PG_FUNCTION_ARGS);
+extern Datum to_tsquery(PG_FUNCTION_ARGS);
+extern Datum plainto_tsquery_byid(PG_FUNCTION_ARGS);
+extern Datum plainto_tsquery(PG_FUNCTION_ARGS);
+
+/*
+ * GiST support function
+ */
+
+extern Datum gtsvector_compress(PG_FUNCTION_ARGS);
+extern Datum gtsvector_decompress(PG_FUNCTION_ARGS);
+extern Datum gtsvector_consistent(PG_FUNCTION_ARGS);
+extern Datum gtsvector_union(PG_FUNCTION_ARGS);
+extern Datum gtsvector_same(PG_FUNCTION_ARGS);
+extern Datum gtsvector_penalty(PG_FUNCTION_ARGS);
+extern Datum gtsvector_picksplit(PG_FUNCTION_ARGS);
+
+/*
+ * IO functions for pseudotype gtsvector
+ * used internally in tsvector GiST opclass
+ */
+extern Datum gtsvectorin(PG_FUNCTION_ARGS);
+extern Datum gtsvectorout(PG_FUNCTION_ARGS);
+
+/*
+ * GIN support function
+ */
+
+extern Datum gin_extract_tsvector(PG_FUNCTION_ARGS);
+extern Datum gin_extract_query(PG_FUNCTION_ARGS);
+extern Datum gin_ts_consistent(PG_FUNCTION_ARGS);
+
+/*
+ * Possible strategy numbers for indexes
+ * TSearchStrategyNumber - (tsvector|text) @@ tsquery
+ * TSearchWithClassStrategyNumber - tsvector @@@ tsquery
+ */
+#define TSearchStrategyNumber 1
+#define TSearchWithClassStrategyNumber 2
+
+/*
+ * TSQuery Utilities
+ */
+extern QueryItem *clean_NOT(QueryItem * ptr, int4 *len);
+extern QueryItem *clean_fakeval(QueryItem * ptr, int4 *len);
+
+typedef struct QTNode
+{
+ QueryItem *valnode;
+ uint32 flags;
+ int4 nchild;
+ char *word;
+ uint32 sign;
+ struct QTNode **child;
+} QTNode;
+
+#define QTN_NEEDFREE 0x01
+#define QTN_NOCHANGE 0x02
+#define QTN_WORDFREE 0x04
+
+typedef uint64 TSQuerySign;
+
+#define TSQS_SIGLEN (sizeof(TSQuerySign)*BITS_PER_BYTE)
+
+
+extern QTNode *QT2QTN(QueryItem * in, char *operand);
+extern TSQuery QTN2QT(QTNode *in);
+extern void QTNFree(QTNode * in);
+extern void QTNSort(QTNode * in);
+extern void QTNTernary(QTNode * in);
+extern void QTNBinary(QTNode * in);
+extern int QTNodeCompare(QTNode * an, QTNode * bn);
+extern QTNode *QTNCopy(QTNode *in);
+extern bool QTNEq(QTNode * a, QTNode * b);
+extern TSQuerySign makeTSQuerySign(TSQuery a);
+
+/*
+ * TSQuery GiST support
+ */
+extern Datum gtsquery_compress(PG_FUNCTION_ARGS);
+extern Datum gtsquery_decompress(PG_FUNCTION_ARGS);
+extern Datum gtsquery_consistent(PG_FUNCTION_ARGS);
+extern Datum gtsquery_union(PG_FUNCTION_ARGS);
+extern Datum gtsquery_same(PG_FUNCTION_ARGS);
+extern Datum gtsquery_penalty(PG_FUNCTION_ARGS);
+extern Datum gtsquery_picksplit(PG_FUNCTION_ARGS);
+
+/*
+ * Parser interface to SQL
+ */
+extern Datum ts_token_type_byid(PG_FUNCTION_ARGS);
+extern Datum ts_token_type_byname(PG_FUNCTION_ARGS);
+extern Datum ts_parse_byid(PG_FUNCTION_ARGS);
+extern Datum ts_parse_byname(PG_FUNCTION_ARGS);
+
+/*
+ * Default word parser
+ */
+
+extern Datum prsd_start(PG_FUNCTION_ARGS);
+extern Datum prsd_nexttoken(PG_FUNCTION_ARGS);
+extern Datum prsd_end(PG_FUNCTION_ARGS);
+extern Datum prsd_headline(PG_FUNCTION_ARGS);
+extern Datum prsd_lextype(PG_FUNCTION_ARGS);
+
+/*
+ * Dictionary interface to SQL
+ */
+extern Datum ts_lexize_byid(PG_FUNCTION_ARGS);
+extern Datum ts_lexize_byname(PG_FUNCTION_ARGS);
+
+/*
+ * Simple built-in dictionary
+ */
+extern Datum dsimple_init(PG_FUNCTION_ARGS);
+extern Datum dsimple_lexize(PG_FUNCTION_ARGS);
+
+/*
+ * Synonym built-in dictionary
+ */
+extern Datum dsynonym_init(PG_FUNCTION_ARGS);
+extern Datum dsynonym_lexize(PG_FUNCTION_ARGS);
+
+/*
+ * ISpell dictionary
+ */
+extern Datum dispell_init(PG_FUNCTION_ARGS);
+extern Datum dispell_lexize(PG_FUNCTION_ARGS);
+
+/*
+ * Thesaurus
+ */
+extern Datum thesaurus_init(PG_FUNCTION_ARGS);
+extern Datum thesaurus_lexize(PG_FUNCTION_ARGS);
+
+/*
+ * headline
+ */
+extern Datum ts_headline_byid_opt(PG_FUNCTION_ARGS);
+extern Datum ts_headline_byid(PG_FUNCTION_ARGS);
+extern Datum ts_headline(PG_FUNCTION_ARGS);
+extern Datum ts_headline_opt(PG_FUNCTION_ARGS);
+
+/*
+ * current cfg
+ */
+extern Datum get_current_ts_config(PG_FUNCTION_ARGS);
+
+#endif /* _PG_TS_UTILS_H_ */
diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index 5eb054e1466..92d153ea5a4 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/acl.h,v 1.101 2007/03/26 16:58:41 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/acl.h,v 1.102 2007/08/21 01:11:29 tgl Exp $
*
* NOTES
* An ACL array is simply an array of AclItems, representing the union
@@ -181,6 +181,8 @@ typedef enum AclObjectKind
ACL_KIND_OPFAMILY, /* pg_opfamily */
ACL_KIND_CONVERSION, /* pg_conversion */
ACL_KIND_TABLESPACE, /* pg_tablespace */
+ ACL_KIND_TSDICTIONARY, /* pg_ts_dict */
+ ACL_KIND_TSCONFIGURATION, /* pg_ts_config */
MAX_ACL_KIND /* MUST BE LAST */
} AclObjectKind;
@@ -281,5 +283,7 @@ extern bool pg_opclass_ownercheck(Oid opc_oid, Oid roleid);
extern bool pg_opfamily_ownercheck(Oid opf_oid, Oid roleid);
extern bool pg_database_ownercheck(Oid db_oid, Oid roleid);
extern bool pg_conversion_ownercheck(Oid conv_oid, Oid roleid);
+extern bool pg_ts_dict_ownercheck(Oid dict_oid, Oid roleid);
+extern bool pg_ts_config_ownercheck(Oid cfg_oid, Oid roleid);
#endif /* ACL_H */
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index de677902d47..ee0532f63b7 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.299 2007/07/25 12:22:54 mha Exp $
+ * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.300 2007/08/21 01:11:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -523,6 +523,14 @@ extern Datum regtypein(PG_FUNCTION_ARGS);
extern Datum regtypeout(PG_FUNCTION_ARGS);
extern Datum regtyperecv(PG_FUNCTION_ARGS);
extern Datum regtypesend(PG_FUNCTION_ARGS);
+extern Datum regconfigin(PG_FUNCTION_ARGS);
+extern Datum regconfigout(PG_FUNCTION_ARGS);
+extern Datum regconfigrecv(PG_FUNCTION_ARGS);
+extern Datum regconfigsend(PG_FUNCTION_ARGS);
+extern Datum regdictionaryin(PG_FUNCTION_ARGS);
+extern Datum regdictionaryout(PG_FUNCTION_ARGS);
+extern Datum regdictionaryrecv(PG_FUNCTION_ARGS);
+extern Datum regdictionarysend(PG_FUNCTION_ARGS);
extern Datum text_regclass(PG_FUNCTION_ARGS);
extern List *stringToQualifiedNameList(const char *string);
extern char *format_procedure(Oid procedure_oid);
diff --git a/src/include/utils/syscache.h b/src/include/utils/syscache.h
index 12cd9a72f22..b34e8803216 100644
--- a/src/include/utils/syscache.h
+++ b/src/include/utils/syscache.h
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.69 2007/04/02 03:49:41 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.70 2007/08/21 01:11:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -65,8 +65,17 @@
#define RELOID 34
#define RULERELNAME 35
#define STATRELATT 36
-#define TYPENAMENSP 37
-#define TYPEOID 38
+#define TSCONFIGMAP 37
+#define TSCONFIGNAMENSP 38
+#define TSCONFIGOID 39
+#define TSDICTNAMENSP 40
+#define TSDICTOID 41
+#define TSPARSERNAMENSP 42
+#define TSPARSEROID 43
+#define TSTEMPLATENAMENSP 44
+#define TSTEMPLATEOID 45
+#define TYPENAMENSP 46
+#define TYPEOID 47
extern void InitCatalogCache(void);
extern void InitCatalogCachePhase2(void);