-<!-- $PostgreSQL: pgsql/doc/src/sgml/indices.sgml,v 1.72 2007/11/13 23:36:26 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/indices.sgml,v 1.73 2008/05/27 00:13:08 tgl Exp $ -->
<chapter id="indexes">
<title id="indexes-title">Indexes</title>
<listitem>
<para>
The operator classes <literal>text_pattern_ops</literal>,
- <literal>varchar_pattern_ops</literal>,
- <literal>bpchar_pattern_ops</literal>, and
- <literal>name_pattern_ops</literal> support B-tree indexes on
- the types <type>text</type>, <type>varchar</type>,
- <type>char</type>, and <type>name</type>, respectively. The
+ <literal>varchar_pattern_ops</literal>, and
+ <literal>bpchar_pattern_ops</literal> support B-tree indexes on
+ the types <type>text</type>, <type>varchar</type>, and
+ <type>char</type> respectively. The
difference from the default operator classes is that the values
are compared strictly character by character rather than
according to the locale-specific collation rules. This makes
CREATE INDEX test_index ON test_table (col varchar_pattern_ops);
</programlisting>
Note that you should also create an index with the default operator
- class if you want queries involving ordinary comparisons to use an
- index. Such queries cannot use the
+ class if you want queries involving ordinary <literal><</>,
+ <literal><=</>, <literal>></>, or <literal>>=</> comparisons
+ to use an index. Such queries cannot use the
<literal><replaceable>xxx</replaceable>_pattern_ops</literal>
- operator classes. It is allowed to create multiple
+ operator classes. (Ordinary equality comparisons can use these
+ operator classes, however.) It is allowed to create multiple
indexes on the same column with different operator classes.
If you do use the C locale, you do not need the
<literal><replaceable>xxx</replaceable>_pattern_ops</literal>
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.55 2008/01/01 19:45:46 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.56 2008/05/27 00:13:08 tgl Exp $
*
* NOTES
*
PG_RETURN_INT32(strncmp(NameStr(*a), NameStr(*b), NAMEDATALEN));
}
-
-Datum
-btname_pattern_cmp(PG_FUNCTION_ARGS)
-{
- Name a = PG_GETARG_NAME(0);
- Name b = PG_GETARG_NAME(1);
-
- PG_RETURN_INT32(memcmp(NameStr(*a), NameStr(*b), NAMEDATALEN));
-}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.230 2008/05/16 16:31:01 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.231 2008/05/27 00:13:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
case OID_NAME_ICLIKE_OP:
case OID_NAME_REGEXEQ_OP:
case OID_NAME_ICREGEXEQ_OP:
- isIndexable =
- (opfamily == NAME_PATTERN_BTREE_FAM_OID) ||
- (opfamily == NAME_BTREE_FAM_OID && lc_collate_is_c());
+ /* name uses locale-insensitive sorting */
+ isIndexable = (opfamily == NAME_BTREE_FAM_OID);
break;
case OID_BYTEA_LIKE_OP:
break;
case NAME_BTREE_FAM_OID:
- case NAME_PATTERN_BTREE_FAM_OID:
datatype = NAMEOID;
break;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/name.c,v 1.61 2008/01/01 19:45:52 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/name.c,v 1.62 2008/05/27 00:13:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
}
-/*
- * comparison routines for LIKE indexing support
- */
-
-Datum
-name_pattern_eq(PG_FUNCTION_ARGS)
-{
- Name arg1 = PG_GETARG_NAME(0);
- Name arg2 = PG_GETARG_NAME(1);
-
- PG_RETURN_BOOL(memcmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) == 0);
-}
-
-Datum
-name_pattern_ne(PG_FUNCTION_ARGS)
-{
- Name arg1 = PG_GETARG_NAME(0);
- Name arg2 = PG_GETARG_NAME(1);
-
- PG_RETURN_BOOL(memcmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) != 0);
-}
-
-Datum
-name_pattern_lt(PG_FUNCTION_ARGS)
-{
- Name arg1 = PG_GETARG_NAME(0);
- Name arg2 = PG_GETARG_NAME(1);
-
- PG_RETURN_BOOL(memcmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) < 0);
-}
-
-Datum
-name_pattern_le(PG_FUNCTION_ARGS)
-{
- Name arg1 = PG_GETARG_NAME(0);
- Name arg2 = PG_GETARG_NAME(1);
-
- PG_RETURN_BOOL(memcmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) <= 0);
-}
-
-Datum
-name_pattern_gt(PG_FUNCTION_ARGS)
-{
- Name arg1 = PG_GETARG_NAME(0);
- Name arg2 = PG_GETARG_NAME(1);
-
- PG_RETURN_BOOL(memcmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) > 0);
-}
-
-Datum
-name_pattern_ge(PG_FUNCTION_ARGS)
-{
- Name arg1 = PG_GETARG_NAME(0);
- Name arg2 = PG_GETARG_NAME(1);
-
- PG_RETURN_BOOL(memcmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) >= 0);
-}
-
-
/* (see char.c for comparison/operation routines) */
int
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/varchar.c,v 1.128 2008/05/04 16:42:41 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/varchar.c,v 1.129 2008/05/27 00:13:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
return result;
}
+
+
+/*
+ * The following operators support character-by-character comparison
+ * of bpchar datums, to allow building indexes suitable for LIKE clauses.
+ * Note that the regular bpchareq/bpcharne comparison operators are assumed
+ * to be compatible with these!
+ */
+
+static int
+internal_bpchar_pattern_compare(BpChar *arg1, BpChar *arg2)
+{
+ int result;
+ int len1,
+ len2;
+
+ len1 = bcTruelen(arg1);
+ len2 = bcTruelen(arg2);
+
+ result = strncmp(VARDATA_ANY(arg1), VARDATA_ANY(arg2), Min(len1, len2));
+ if (result != 0)
+ return result;
+ else if (len1 < len2)
+ return -1;
+ else if (len1 > len2)
+ return 1;
+ else
+ return 0;
+}
+
+
+Datum
+bpchar_pattern_lt(PG_FUNCTION_ARGS)
+{
+ BpChar *arg1 = PG_GETARG_BPCHAR_PP(0);
+ BpChar *arg2 = PG_GETARG_BPCHAR_PP(1);
+ int result;
+
+ result = internal_bpchar_pattern_compare(arg1, arg2);
+
+ PG_FREE_IF_COPY(arg1, 0);
+ PG_FREE_IF_COPY(arg2, 1);
+
+ PG_RETURN_BOOL(result < 0);
+}
+
+
+Datum
+bpchar_pattern_le(PG_FUNCTION_ARGS)
+{
+ BpChar *arg1 = PG_GETARG_BPCHAR_PP(0);
+ BpChar *arg2 = PG_GETARG_BPCHAR_PP(1);
+ int result;
+
+ result = internal_bpchar_pattern_compare(arg1, arg2);
+
+ PG_FREE_IF_COPY(arg1, 0);
+ PG_FREE_IF_COPY(arg2, 1);
+
+ PG_RETURN_BOOL(result <= 0);
+}
+
+
+Datum
+bpchar_pattern_ge(PG_FUNCTION_ARGS)
+{
+ BpChar *arg1 = PG_GETARG_BPCHAR_PP(0);
+ BpChar *arg2 = PG_GETARG_BPCHAR_PP(1);
+ int result;
+
+ result = internal_bpchar_pattern_compare(arg1, arg2);
+
+ PG_FREE_IF_COPY(arg1, 0);
+ PG_FREE_IF_COPY(arg2, 1);
+
+ PG_RETURN_BOOL(result >= 0);
+}
+
+
+Datum
+bpchar_pattern_gt(PG_FUNCTION_ARGS)
+{
+ BpChar *arg1 = PG_GETARG_BPCHAR_PP(0);
+ BpChar *arg2 = PG_GETARG_BPCHAR_PP(1);
+ int result;
+
+ result = internal_bpchar_pattern_compare(arg1, arg2);
+
+ PG_FREE_IF_COPY(arg1, 0);
+ PG_FREE_IF_COPY(arg2, 1);
+
+ PG_RETURN_BOOL(result > 0);
+}
+
+
+Datum
+btbpchar_pattern_cmp(PG_FUNCTION_ARGS)
+{
+ BpChar *arg1 = PG_GETARG_BPCHAR_PP(0);
+ BpChar *arg2 = PG_GETARG_BPCHAR_PP(1);
+ int result;
+
+ result = internal_bpchar_pattern_compare(arg1, arg2);
+
+ PG_FREE_IF_COPY(arg1, 0);
+ PG_FREE_IF_COPY(arg2, 1);
+
+ PG_RETURN_INT32(result);
+}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.166 2008/05/12 00:00:51 alvherre Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.167 2008/05/27 00:13:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/*
* The following operators support character-by-character comparison
- * of text data types, to allow building indexes suitable for LIKE
- * clauses.
+ * of text datums, to allow building indexes suitable for LIKE clauses.
+ * Note that the regular texteq/textne comparison operators are assumed
+ * to be compatible with these!
*/
static int
internal_text_pattern_compare(text *arg1, text *arg2)
{
int result;
+ int len1,
+ len2;
+
+ len1 = VARSIZE_ANY_EXHDR(arg1);
+ len2 = VARSIZE_ANY_EXHDR(arg2);
- result = memcmp(VARDATA_ANY(arg1), VARDATA_ANY(arg2),
- Min(VARSIZE_ANY_EXHDR(arg1), VARSIZE_ANY_EXHDR(arg2)));
+ result = strncmp(VARDATA_ANY(arg1), VARDATA_ANY(arg2), Min(len1, len2));
if (result != 0)
return result;
- else if (VARSIZE_ANY_EXHDR(arg1) < VARSIZE_ANY_EXHDR(arg2))
+ else if (len1 < len2)
return -1;
- else if (VARSIZE_ANY_EXHDR(arg1) > VARSIZE_ANY_EXHDR(arg2))
+ else if (len1 > len2)
return 1;
else
return 0;
}
-Datum
-text_pattern_eq(PG_FUNCTION_ARGS)
-{
- text *arg1 = PG_GETARG_TEXT_PP(0);
- text *arg2 = PG_GETARG_TEXT_PP(1);
- int result;
-
- if (VARSIZE_ANY_EXHDR(arg1) != VARSIZE_ANY_EXHDR(arg2))
- result = 1;
- else
- result = internal_text_pattern_compare(arg1, arg2);
-
- PG_FREE_IF_COPY(arg1, 0);
- PG_FREE_IF_COPY(arg2, 1);
-
- PG_RETURN_BOOL(result == 0);
-}
-
-
Datum
text_pattern_ge(PG_FUNCTION_ARGS)
{
}
-Datum
-text_pattern_ne(PG_FUNCTION_ARGS)
-{
- text *arg1 = PG_GETARG_TEXT_PP(0);
- text *arg2 = PG_GETARG_TEXT_PP(1);
- int result;
-
- if (VARSIZE_ANY_EXHDR(arg1) != VARSIZE_ANY_EXHDR(arg2))
- result = 1;
- else
- result = internal_text_pattern_compare(arg1, arg2);
-
- PG_FREE_IF_COPY(arg1, 0);
- PG_FREE_IF_COPY(arg2, 1);
-
- PG_RETURN_BOOL(result != 0);
-}
-
-
Datum
bttext_pattern_cmp(PG_FUNCTION_ARGS)
{
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.461 2008/05/16 23:36:05 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.462 2008/05/27 00:13:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200805162
+#define CATALOG_VERSION_NO 200805261
#endif
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_amop.h,v 1.86 2008/04/14 17:05:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_amop.h,v 1.87 2008/05/27 00:13:09 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
DATA(insert ( 2095 25 25 1 2314 403 ));
DATA(insert ( 2095 25 25 2 2315 403 ));
-DATA(insert ( 2095 25 25 3 2316 403 ));
+DATA(insert ( 2095 25 25 3 98 403 ));
DATA(insert ( 2095 25 25 4 2317 403 ));
DATA(insert ( 2095 25 25 5 2318 403 ));
DATA(insert ( 2097 1042 1042 1 2326 403 ));
DATA(insert ( 2097 1042 1042 2 2327 403 ));
-DATA(insert ( 2097 1042 1042 3 2328 403 ));
+DATA(insert ( 2097 1042 1042 3 1054 403 ));
DATA(insert ( 2097 1042 1042 4 2329 403 ));
DATA(insert ( 2097 1042 1042 5 2330 403 ));
-/*
- * btree name pattern
- */
-
-DATA(insert ( 2098 19 19 1 2332 403 ));
-DATA(insert ( 2098 19 19 2 2333 403 ));
-DATA(insert ( 2098 19 19 3 2334 403 ));
-DATA(insert ( 2098 19 19 4 2335 403 ));
-DATA(insert ( 2098 19 19 5 2336 403 ));
-
/*
* btree money_ops
*/
/* reltime_ops */
DATA(insert ( 2228 703 703 1 566 405 ));
/* text_pattern_ops */
-DATA(insert ( 2229 25 25 1 2316 405 ));
+DATA(insert ( 2229 25 25 1 98 405 ));
/* bpchar_pattern_ops */
-DATA(insert ( 2231 1042 1042 1 2328 405 ));
-/* name_pattern_ops */
-DATA(insert ( 2232 19 19 1 2334 405 ));
+DATA(insert ( 2231 1042 1042 1 1054 405 ));
/* aclitem_ops */
DATA(insert ( 2235 1033 1033 1 974 405 ));
/* uuid_ops */
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_amproc.h,v 1.72 2008/05/16 16:31:01 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_amproc.h,v 1.73 2008/05/27 00:13:09 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
DATA(insert ( 2002 1562 1562 1 1672 ));
DATA(insert ( 2095 25 25 1 2166 ));
DATA(insert ( 2097 1042 1042 1 2180 ));
-DATA(insert ( 2098 19 19 1 2187 ));
DATA(insert ( 2099 790 790 1 377 ));
DATA(insert ( 2233 703 703 1 380 ));
DATA(insert ( 2234 704 704 1 381 ));
DATA(insert ( 2226 29 29 1 450 ));
DATA(insert ( 2227 702 702 1 450 ));
DATA(insert ( 2228 703 703 1 450 ));
-DATA(insert ( 2229 25 25 1 456 ));
-DATA(insert ( 2231 1042 1042 1 456 ));
-DATA(insert ( 2232 19 19 1 455 ));
+DATA(insert ( 2229 25 25 1 400 ));
+DATA(insert ( 2231 1042 1042 1 1080 ));
DATA(insert ( 2235 1033 1033 1 329 ));
DATA(insert ( 2969 2950 2950 1 2963 ));
DATA(insert ( 3523 3500 3500 1 3515 ));
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_opclass.h,v 1.80 2008/03/27 03:57:34 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_opclass.h,v 1.81 2008/05/27 00:13:09 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
DATA(insert ( 403 text_pattern_ops PGNSP PGUID 2095 25 f 0 ));
DATA(insert ( 403 varchar_pattern_ops PGNSP PGUID 2095 25 f 0 ));
DATA(insert ( 403 bpchar_pattern_ops PGNSP PGUID 2097 1042 f 0 ));
-DATA(insert ( 403 name_pattern_ops PGNSP PGUID 2098 19 f 0 ));
DATA(insert ( 403 money_ops PGNSP PGUID 2099 790 t 0 ));
DATA(insert ( 405 bool_ops PGNSP PGUID 2222 16 t 0 ));
DATA(insert ( 405 bytea_ops PGNSP PGUID 2223 17 t 0 ));
DATA(insert ( 405 text_pattern_ops PGNSP PGUID 2229 25 f 0 ));
DATA(insert ( 405 varchar_pattern_ops PGNSP PGUID 2229 25 f 0 ));
DATA(insert ( 405 bpchar_pattern_ops PGNSP PGUID 2231 1042 f 0 ));
-DATA(insert ( 405 name_pattern_ops PGNSP PGUID 2232 19 f 0 ));
DATA(insert ( 403 reltime_ops PGNSP PGUID 2233 703 t 0 ));
DATA(insert ( 403 tinterval_ops PGNSP PGUID 2234 704 t 0 ));
DATA(insert ( 405 aclitem_ops PGNSP PGUID 2235 1033 t 0 ));
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.158 2008/03/27 03:57:34 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.159 2008/05/27 00:13:09 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
DATA(insert OID = 2314 ( "~<~" PGNSP PGUID b f f 25 25 16 2318 2317 text_pattern_lt scalarltsel scalarltjoinsel ));
DATA(insert OID = 2315 ( "~<=~" PGNSP PGUID b f f 25 25 16 2317 2318 text_pattern_le scalarltsel scalarltjoinsel ));
-DATA(insert OID = 2316 ( "~=~" PGNSP PGUID b t t 25 25 16 2316 2319 text_pattern_eq eqsel eqjoinsel ));
DATA(insert OID = 2317 ( "~>=~" PGNSP PGUID b f f 25 25 16 2315 2314 text_pattern_ge scalargtsel scalargtjoinsel ));
DATA(insert OID = 2318 ( "~>~" PGNSP PGUID b f f 25 25 16 2314 2315 text_pattern_gt scalargtsel scalargtjoinsel ));
-DATA(insert OID = 2319 ( "~<>~" PGNSP PGUID b f f 25 25 16 2319 2316 text_pattern_ne neqsel neqjoinsel ));
DATA(insert OID = 2326 ( "~<~" PGNSP PGUID b f f 1042 1042 16 2330 2329 bpchar_pattern_lt scalarltsel scalarltjoinsel ));
DATA(insert OID = 2327 ( "~<=~" PGNSP PGUID b f f 1042 1042 16 2329 2330 bpchar_pattern_le scalarltsel scalarltjoinsel ));
-DATA(insert OID = 2328 ( "~=~" PGNSP PGUID b t t 1042 1042 16 2328 2331 bpchar_pattern_eq eqsel eqjoinsel ));
DATA(insert OID = 2329 ( "~>=~" PGNSP PGUID b f f 1042 1042 16 2327 2326 bpchar_pattern_ge scalargtsel scalargtjoinsel ));
DATA(insert OID = 2330 ( "~>~" PGNSP PGUID b f f 1042 1042 16 2326 2327 bpchar_pattern_gt scalargtsel scalargtjoinsel ));
-DATA(insert OID = 2331 ( "~<>~" PGNSP PGUID b f f 1042 1042 16 2331 2328 bpchar_pattern_ne neqsel neqjoinsel ));
-
-DATA(insert OID = 2332 ( "~<~" PGNSP PGUID b f f 19 19 16 2336 2335 name_pattern_lt scalarltsel scalarltjoinsel ));
-DATA(insert OID = 2333 ( "~<=~" PGNSP PGUID b f f 19 19 16 2335 2336 name_pattern_le scalarltsel scalarltjoinsel ));
-DATA(insert OID = 2334 ( "~=~" PGNSP PGUID b t t 19 19 16 2334 2337 name_pattern_eq eqsel eqjoinsel ));
-DATA(insert OID = 2335 ( "~>=~" PGNSP PGUID b f f 19 19 16 2333 2332 name_pattern_ge scalargtsel scalargtjoinsel ));
-DATA(insert OID = 2336 ( "~>~" PGNSP PGUID b f f 19 19 16 2332 2333 name_pattern_gt scalargtsel scalargtjoinsel ));
-DATA(insert OID = 2337 ( "~<>~" PGNSP PGUID b f f 19 19 16 2337 2334 name_pattern_ne neqsel neqjoinsel ));
/* crosstype operations for date vs. timestamp and timestamptz */
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_opfamily.h,v 1.8 2008/03/27 03:57:34 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_opfamily.h,v 1.9 2008/05/27 00:13:09 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
#define TEXT_PATTERN_BTREE_FAM_OID 2095
DATA(insert OID = 2097 ( 403 bpchar_pattern_ops PGNSP PGUID ));
#define BPCHAR_PATTERN_BTREE_FAM_OID 2097
-DATA(insert OID = 2098 ( 403 name_pattern_ops PGNSP PGUID ));
-#define NAME_PATTERN_BTREE_FAM_OID 2098
DATA(insert OID = 2099 ( 403 money_ops PGNSP PGUID ));
DATA(insert OID = 2222 ( 405 bool_ops PGNSP PGUID ));
#define BOOL_HASH_FAM_OID 2222
DATA(insert OID = 2228 ( 405 reltime_ops PGNSP PGUID ));
DATA(insert OID = 2229 ( 405 text_pattern_ops PGNSP PGUID ));
DATA(insert OID = 2231 ( 405 bpchar_pattern_ops PGNSP PGUID ));
-DATA(insert OID = 2232 ( 405 name_pattern_ops PGNSP PGUID ));
DATA(insert OID = 2233 ( 403 reltime_ops PGNSP PGUID ));
DATA(insert OID = 2234 ( 403 tinterval_ops PGNSP PGUID ));
DATA(insert OID = 2235 ( 405 aclitem_ops PGNSP PGUID ));
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.500 2008/05/16 16:31:01 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.501 2008/05/27 00:13:09 tgl Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
DATA(insert OID = 2160 ( text_pattern_lt PGNSP PGUID 12 1 0 f f t f i 2 16 "25 25" _null_ _null_ _null_ text_pattern_lt - _null_ _null_ ));
DATA(insert OID = 2161 ( text_pattern_le PGNSP PGUID 12 1 0 f f t f i 2 16 "25 25" _null_ _null_ _null_ text_pattern_le - _null_ _null_ ));
-DATA(insert OID = 2162 ( text_pattern_eq PGNSP PGUID 12 1 0 f f t f i 2 16 "25 25" _null_ _null_ _null_ text_pattern_eq - _null_ _null_ ));
DATA(insert OID = 2163 ( text_pattern_ge PGNSP PGUID 12 1 0 f f t f i 2 16 "25 25" _null_ _null_ _null_ text_pattern_ge - _null_ _null_ ));
DATA(insert OID = 2164 ( text_pattern_gt PGNSP PGUID 12 1 0 f f t f i 2 16 "25 25" _null_ _null_ _null_ text_pattern_gt - _null_ _null_ ));
-DATA(insert OID = 2165 ( text_pattern_ne PGNSP PGUID 12 1 0 f f t f i 2 16 "25 25" _null_ _null_ _null_ text_pattern_ne - _null_ _null_ ));
DATA(insert OID = 2166 ( bttext_pattern_cmp PGNSP PGUID 12 1 0 f f t f i 2 23 "25 25" _null_ _null_ _null_ bttext_pattern_cmp - _null_ _null_ ));
-/* We use the same procedures here as above since the types are binary compatible. */
-DATA(insert OID = 2174 ( bpchar_pattern_lt PGNSP PGUID 12 1 0 f f t f i 2 16 "1042 1042" _null_ _null_ _null_ text_pattern_lt - _null_ _null_ ));
-DATA(insert OID = 2175 ( bpchar_pattern_le PGNSP PGUID 12 1 0 f f t f i 2 16 "1042 1042" _null_ _null_ _null_ text_pattern_le - _null_ _null_ ));
-DATA(insert OID = 2176 ( bpchar_pattern_eq PGNSP PGUID 12 1 0 f f t f i 2 16 "1042 1042" _null_ _null_ _null_ text_pattern_eq - _null_ _null_ ));
-DATA(insert OID = 2177 ( bpchar_pattern_ge PGNSP PGUID 12 1 0 f f t f i 2 16 "1042 1042" _null_ _null_ _null_ text_pattern_ge - _null_ _null_ ));
-DATA(insert OID = 2178 ( bpchar_pattern_gt PGNSP PGUID 12 1 0 f f t f i 2 16 "1042 1042" _null_ _null_ _null_ text_pattern_gt - _null_ _null_ ));
-DATA(insert OID = 2179 ( bpchar_pattern_ne PGNSP PGUID 12 1 0 f f t f i 2 16 "1042 1042" _null_ _null_ _null_ text_pattern_ne - _null_ _null_ ));
-DATA(insert OID = 2180 ( btbpchar_pattern_cmp PGNSP PGUID 12 1 0 f f t f i 2 23 "1042 1042" _null_ _null_ _null_ bttext_pattern_cmp - _null_ _null_ ));
-
-DATA(insert OID = 2181 ( name_pattern_lt PGNSP PGUID 12 1 0 f f t f i 2 16 "19 19" _null_ _null_ _null_ name_pattern_lt - _null_ _null_ ));
-DATA(insert OID = 2182 ( name_pattern_le PGNSP PGUID 12 1 0 f f t f i 2 16 "19 19" _null_ _null_ _null_ name_pattern_le - _null_ _null_ ));
-DATA(insert OID = 2183 ( name_pattern_eq PGNSP PGUID 12 1 0 f f t f i 2 16 "19 19" _null_ _null_ _null_ name_pattern_eq - _null_ _null_ ));
-DATA(insert OID = 2184 ( name_pattern_ge PGNSP PGUID 12 1 0 f f t f i 2 16 "19 19" _null_ _null_ _null_ name_pattern_ge - _null_ _null_ ));
-DATA(insert OID = 2185 ( name_pattern_gt PGNSP PGUID 12 1 0 f f t f i 2 16 "19 19" _null_ _null_ _null_ name_pattern_gt - _null_ _null_ ));
-DATA(insert OID = 2186 ( name_pattern_ne PGNSP PGUID 12 1 0 f f t f i 2 16 "19 19" _null_ _null_ _null_ name_pattern_ne - _null_ _null_ ));
-DATA(insert OID = 2187 ( btname_pattern_cmp PGNSP PGUID 12 1 0 f f t f i 2 23 "19 19" _null_ _null_ _null_ btname_pattern_cmp - _null_ _null_ ));
+DATA(insert OID = 2174 ( bpchar_pattern_lt PGNSP PGUID 12 1 0 f f t f i 2 16 "1042 1042" _null_ _null_ _null_ bpchar_pattern_lt - _null_ _null_ ));
+DATA(insert OID = 2175 ( bpchar_pattern_le PGNSP PGUID 12 1 0 f f t f i 2 16 "1042 1042" _null_ _null_ _null_ bpchar_pattern_le - _null_ _null_ ));
+DATA(insert OID = 2177 ( bpchar_pattern_ge PGNSP PGUID 12 1 0 f f t f i 2 16 "1042 1042" _null_ _null_ _null_ bpchar_pattern_ge - _null_ _null_ ));
+DATA(insert OID = 2178 ( bpchar_pattern_gt PGNSP PGUID 12 1 0 f f t f i 2 16 "1042 1042" _null_ _null_ _null_ bpchar_pattern_gt - _null_ _null_ ));
+DATA(insert OID = 2180 ( btbpchar_pattern_cmp PGNSP PGUID 12 1 0 f f t f i 2 23 "1042 1042" _null_ _null_ _null_ btbpchar_pattern_cmp - _null_ _null_ ));
DATA(insert OID = 2188 ( btint48cmp PGNSP PGUID 12 1 0 f f t f i 2 23 "23 20" _null_ _null_ _null_ btint48cmp - _null_ _null_ ));
DATA(insert OID = 2189 ( btint84cmp PGNSP PGUID 12 1 0 f f t f i 2 23 "20 23" _null_ _null_ _null_ btint84cmp - _null_ _null_ ));
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.315 2008/04/17 20:56:41 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.316 2008/05/27 00:13:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern Datum namele(PG_FUNCTION_ARGS);
extern Datum namegt(PG_FUNCTION_ARGS);
extern Datum namege(PG_FUNCTION_ARGS);
-extern Datum name_pattern_eq(PG_FUNCTION_ARGS);
-extern Datum name_pattern_ne(PG_FUNCTION_ARGS);
-extern Datum name_pattern_lt(PG_FUNCTION_ARGS);
-extern Datum name_pattern_le(PG_FUNCTION_ARGS);
-extern Datum name_pattern_gt(PG_FUNCTION_ARGS);
-extern Datum name_pattern_ge(PG_FUNCTION_ARGS);
extern int namecpy(Name n1, Name n2);
extern int namestrcpy(Name name, const char *str);
extern int namestrcmp(Name name, const char *str);
extern Datum btcharcmp(PG_FUNCTION_ARGS);
extern Datum btnamecmp(PG_FUNCTION_ARGS);
extern Datum bttextcmp(PG_FUNCTION_ARGS);
-extern Datum btname_pattern_cmp(PG_FUNCTION_ARGS);
-extern Datum bttext_pattern_cmp(PG_FUNCTION_ARGS);
/* float.c */
extern PGDLLIMPORT int extra_float_digits;
extern Datum bpcharlen(PG_FUNCTION_ARGS);
extern Datum bpcharoctetlen(PG_FUNCTION_ARGS);
extern Datum hashbpchar(PG_FUNCTION_ARGS);
+extern Datum bpchar_pattern_lt(PG_FUNCTION_ARGS);
+extern Datum bpchar_pattern_le(PG_FUNCTION_ARGS);
+extern Datum bpchar_pattern_gt(PG_FUNCTION_ARGS);
+extern Datum bpchar_pattern_ge(PG_FUNCTION_ARGS);
+extern Datum btbpchar_pattern_cmp(PG_FUNCTION_ARGS);
extern Datum varcharin(PG_FUNCTION_ARGS);
extern Datum varcharout(PG_FUNCTION_ARGS);
extern Datum text_ge(PG_FUNCTION_ARGS);
extern Datum text_larger(PG_FUNCTION_ARGS);
extern Datum text_smaller(PG_FUNCTION_ARGS);
-extern Datum text_pattern_eq(PG_FUNCTION_ARGS);
-extern Datum text_pattern_ne(PG_FUNCTION_ARGS);
extern Datum text_pattern_lt(PG_FUNCTION_ARGS);
extern Datum text_pattern_le(PG_FUNCTION_ARGS);
extern Datum text_pattern_gt(PG_FUNCTION_ARGS);
extern Datum text_pattern_ge(PG_FUNCTION_ARGS);
+extern Datum bttext_pattern_cmp(PG_FUNCTION_ARGS);
extern Datum textlen(PG_FUNCTION_ARGS);
extern Datum textoctetlen(PG_FUNCTION_ARGS);
extern Datum textpos(PG_FUNCTION_ARGS);
proargtypes | proargtypes
-------------+-------------
23 | 28
- 25 | 1042
1114 | 1184
1560 | 1562
2277 | 2283
-(5 rows)
+(4 rows)
SELECT DISTINCT p1.proargtypes[2], p2.proargtypes[2]
FROM pg_proc AS p1, pg_proc AS p2
403 | 2 | <=
403 | 2 | ~<=~
403 | 3 | =
- 403 | 3 | ~=~
403 | 4 | >=
403 | 4 | ~>=~
403 | 5 | >
403 | 5 | ~>~
405 | 1 | =
- 405 | 1 | ~=~
783 | 1 | <<
783 | 1 | @@
783 | 2 | &<
2742 | 2 | @@@
2742 | 3 | <@
2742 | 4 | =
-(33 rows)
+(31 rows)
-- Check that all operators linked to by opclass entries have selectivity
-- estimators. This is not absolutely required, but it seems a reasonable
OR NOT physically_coercible(amproclefttype, proargtypes[0])
OR amproclefttype != amprocrighttype)
ORDER BY 1;
- amprocfamily | amprocnum | proname | opfname
---------------+-----------+----------------+--------------------
+ amprocfamily | amprocnum | proname | opfname
+--------------+-----------+----------------+-----------------
435 | 1 | hashint4 | date_ops
1999 | 1 | timestamp_hash | timestamptz_ops
2222 | 1 | hashchar | bool_ops
2223 | 1 | hashvarlena | bytea_ops
2225 | 1 | hashint4 | xid_ops
2226 | 1 | hashint4 | cid_ops
- 2229 | 1 | hashvarlena | text_pattern_ops
- 2231 | 1 | hashvarlena | bpchar_pattern_ops
-(8 rows)
+(6 rows)
-- Support routines that are primary members of opfamilies must be immutable
-- (else it suggests that the index ordering isn't fixed). But cross-type