Commit 595a5a78 authored by Bruce Momjian's avatar Bruce Momjian

> Okay. When you get back to the original issue, the gold is hidden in

> src/backend/optimizer/path/indxpath.c; see the "special indexable
> operators" stuff near the bottom of that file.  (It's a bit of a crock
> that this code is hardwired there, and not somehow accessed through a
> system catalog, but it's what we've got at the moment.)

The attached patch re-enables a bytea right hand argument (as compared
to a text right hand argument), and enables index usage, for bytea LIKE

Joe Conway
parent 81efc826
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.120 2002/07/13 19:20:34 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.121 2002/09/02 06:22:18 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -97,7 +97,7 @@ static bool function_index_operand(Expr *funcOpnd, RelOptInfo *rel, ...@@ -97,7 +97,7 @@ static bool function_index_operand(Expr *funcOpnd, RelOptInfo *rel,
static bool match_special_index_operator(Expr *clause, Oid opclass, static bool match_special_index_operator(Expr *clause, Oid opclass,
bool indexkey_on_left); bool indexkey_on_left);
static List *prefix_quals(Var *leftop, Oid expr_op, static List *prefix_quals(Var *leftop, Oid expr_op,
char *prefix, Pattern_Prefix_Status pstatus); Const *prefix, Pattern_Prefix_Status pstatus);
static List *network_prefix_quals(Var *leftop, Oid expr_op, Datum rightop); static List *network_prefix_quals(Var *leftop, Oid expr_op, Datum rightop);
static Oid find_operator(const char *opname, Oid datatype); static Oid find_operator(const char *opname, Oid datatype);
static Datum string_to_datum(const char *str, Oid datatype); static Datum string_to_datum(const char *str, Oid datatype);
...@@ -1675,10 +1675,9 @@ match_special_index_operator(Expr *clause, Oid opclass, ...@@ -1675,10 +1675,9 @@ match_special_index_operator(Expr *clause, Oid opclass,
Var *leftop, Var *leftop,
*rightop; *rightop;
Oid expr_op; Oid expr_op;
Datum constvalue; Const *patt = NULL;
char *patt; Const *prefix = NULL;
char *prefix; Const *rest = NULL;
char *rest;
/* /*
* Currently, all known special operators require the indexkey on the * Currently, all known special operators require the indexkey on the
...@@ -1697,7 +1696,7 @@ match_special_index_operator(Expr *clause, Oid opclass, ...@@ -1697,7 +1696,7 @@ match_special_index_operator(Expr *clause, Oid opclass,
if (!IsA(rightop, Const) || if (!IsA(rightop, Const) ||
((Const *) rightop)->constisnull) ((Const *) rightop)->constisnull)
return false; return false;
constvalue = ((Const *) rightop)->constvalue; patt = (Const *) rightop;
switch (expr_op) switch (expr_op)
{ {
...@@ -1705,68 +1704,45 @@ match_special_index_operator(Expr *clause, Oid opclass, ...@@ -1705,68 +1704,45 @@ match_special_index_operator(Expr *clause, Oid opclass,
case OID_BPCHAR_LIKE_OP: case OID_BPCHAR_LIKE_OP:
case OID_VARCHAR_LIKE_OP: case OID_VARCHAR_LIKE_OP:
case OID_NAME_LIKE_OP: case OID_NAME_LIKE_OP:
/* the right-hand const is type text for all of these */
if (locale_is_like_safe()) if (locale_is_like_safe())
{
/* the right-hand const is type text for all of these */
patt = DatumGetCString(DirectFunctionCall1(textout,
constvalue));
isIndexable = pattern_fixed_prefix(patt, Pattern_Type_Like, isIndexable = pattern_fixed_prefix(patt, Pattern_Type_Like,
&prefix, &rest) != Pattern_Prefix_None; &prefix, &rest) != Pattern_Prefix_None;
if (prefix) break;
pfree(prefix);
pfree(patt); case OID_BYTEA_LIKE_OP:
} isIndexable = pattern_fixed_prefix(patt, Pattern_Type_Like,
&prefix, &rest) != Pattern_Prefix_None;
break; break;
case OID_TEXT_ICLIKE_OP: case OID_TEXT_ICLIKE_OP:
case OID_BPCHAR_ICLIKE_OP: case OID_BPCHAR_ICLIKE_OP:
case OID_VARCHAR_ICLIKE_OP: case OID_VARCHAR_ICLIKE_OP:
case OID_NAME_ICLIKE_OP: case OID_NAME_ICLIKE_OP:
/* the right-hand const is type text for all of these */
if (locale_is_like_safe()) if (locale_is_like_safe())
{
/* the right-hand const is type text for all of these */
patt = DatumGetCString(DirectFunctionCall1(textout,
constvalue));
isIndexable = pattern_fixed_prefix(patt, Pattern_Type_Like_IC, isIndexable = pattern_fixed_prefix(patt, Pattern_Type_Like_IC,
&prefix, &rest) != Pattern_Prefix_None; &prefix, &rest) != Pattern_Prefix_None;
if (prefix)
pfree(prefix);
pfree(patt);
}
break; break;
case OID_TEXT_REGEXEQ_OP: case OID_TEXT_REGEXEQ_OP:
case OID_BPCHAR_REGEXEQ_OP: case OID_BPCHAR_REGEXEQ_OP:
case OID_VARCHAR_REGEXEQ_OP: case OID_VARCHAR_REGEXEQ_OP:
case OID_NAME_REGEXEQ_OP: case OID_NAME_REGEXEQ_OP:
/* the right-hand const is type text for all of these */
if (locale_is_like_safe()) if (locale_is_like_safe())
{
/* the right-hand const is type text for all of these */
patt = DatumGetCString(DirectFunctionCall1(textout,
constvalue));
isIndexable = pattern_fixed_prefix(patt, Pattern_Type_Regex, isIndexable = pattern_fixed_prefix(patt, Pattern_Type_Regex,
&prefix, &rest) != Pattern_Prefix_None; &prefix, &rest) != Pattern_Prefix_None;
if (prefix)
pfree(prefix);
pfree(patt);
}
break; break;
case OID_TEXT_ICREGEXEQ_OP: case OID_TEXT_ICREGEXEQ_OP:
case OID_BPCHAR_ICREGEXEQ_OP: case OID_BPCHAR_ICREGEXEQ_OP:
case OID_VARCHAR_ICREGEXEQ_OP: case OID_VARCHAR_ICREGEXEQ_OP:
case OID_NAME_ICREGEXEQ_OP: case OID_NAME_ICREGEXEQ_OP:
/* the right-hand const is type text for all of these */
if (locale_is_like_safe()) if (locale_is_like_safe())
{
/* the right-hand const is type text for all of these */
patt = DatumGetCString(DirectFunctionCall1(textout,
constvalue));
isIndexable = pattern_fixed_prefix(patt, Pattern_Type_Regex_IC, isIndexable = pattern_fixed_prefix(patt, Pattern_Type_Regex_IC,
&prefix, &rest) != Pattern_Prefix_None; &prefix, &rest) != Pattern_Prefix_None;
if (prefix)
pfree(prefix);
pfree(patt);
}
break; break;
case OID_INET_SUB_OP: case OID_INET_SUB_OP:
...@@ -1777,6 +1753,12 @@ match_special_index_operator(Expr *clause, Oid opclass, ...@@ -1777,6 +1753,12 @@ match_special_index_operator(Expr *clause, Oid opclass,
break; break;
} }
if (prefix)
{
pfree(DatumGetPointer(prefix->constvalue));
pfree(prefix);
}
/* done if the expression doesn't look indexable */ /* done if the expression doesn't look indexable */
if (!isIndexable) if (!isIndexable)
return false; return false;
...@@ -1798,6 +1780,12 @@ match_special_index_operator(Expr *clause, Oid opclass, ...@@ -1798,6 +1780,12 @@ match_special_index_operator(Expr *clause, Oid opclass,
isIndexable = false; isIndexable = false;
break; break;
case OID_BYTEA_LIKE_OP:
if (!op_in_opclass(find_operator(">=", BYTEAOID), opclass) ||
!op_in_opclass(find_operator("<", BYTEAOID), opclass))
isIndexable = false;
break;
case OID_BPCHAR_LIKE_OP: case OID_BPCHAR_LIKE_OP:
case OID_BPCHAR_ICLIKE_OP: case OID_BPCHAR_ICLIKE_OP:
case OID_BPCHAR_REGEXEQ_OP: case OID_BPCHAR_REGEXEQ_OP:
...@@ -1867,10 +1855,9 @@ expand_indexqual_conditions(List *indexquals) ...@@ -1867,10 +1855,9 @@ expand_indexqual_conditions(List *indexquals)
Var *leftop = get_leftop(clause); Var *leftop = get_leftop(clause);
Var *rightop = get_rightop(clause); Var *rightop = get_rightop(clause);
Oid expr_op = ((Oper *) clause->oper)->opno; Oid expr_op = ((Oper *) clause->oper)->opno;
Datum constvalue; Const *patt = (Const *) rightop;
char *patt; Const *prefix = NULL;
char *prefix; Const *rest = NULL;
char *rest;
Pattern_Prefix_Status pstatus; Pattern_Prefix_Status pstatus;
switch (expr_op) switch (expr_op)
...@@ -1885,18 +1872,12 @@ expand_indexqual_conditions(List *indexquals) ...@@ -1885,18 +1872,12 @@ expand_indexqual_conditions(List *indexquals)
case OID_BPCHAR_LIKE_OP: case OID_BPCHAR_LIKE_OP:
case OID_VARCHAR_LIKE_OP: case OID_VARCHAR_LIKE_OP:
case OID_NAME_LIKE_OP: case OID_NAME_LIKE_OP:
/* the right-hand const is type text for all of these */ case OID_BYTEA_LIKE_OP:
constvalue = ((Const *) rightop)->constvalue;
patt = DatumGetCString(DirectFunctionCall1(textout,
constvalue));
pstatus = pattern_fixed_prefix(patt, Pattern_Type_Like, pstatus = pattern_fixed_prefix(patt, Pattern_Type_Like,
&prefix, &rest); &prefix, &rest);
resultquals = nconc(resultquals, resultquals = nconc(resultquals,
prefix_quals(leftop, expr_op, prefix_quals(leftop, expr_op,
prefix, pstatus)); prefix, pstatus));
if (prefix)
pfree(prefix);
pfree(patt);
break; break;
case OID_TEXT_ICLIKE_OP: case OID_TEXT_ICLIKE_OP:
...@@ -1904,17 +1885,11 @@ expand_indexqual_conditions(List *indexquals) ...@@ -1904,17 +1885,11 @@ expand_indexqual_conditions(List *indexquals)
case OID_VARCHAR_ICLIKE_OP: case OID_VARCHAR_ICLIKE_OP:
case OID_NAME_ICLIKE_OP: case OID_NAME_ICLIKE_OP:
/* the right-hand const is type text for all of these */ /* the right-hand const is type text for all of these */
constvalue = ((Const *) rightop)->constvalue;
patt = DatumGetCString(DirectFunctionCall1(textout,
constvalue));
pstatus = pattern_fixed_prefix(patt, Pattern_Type_Like_IC, pstatus = pattern_fixed_prefix(patt, Pattern_Type_Like_IC,
&prefix, &rest); &prefix, &rest);
resultquals = nconc(resultquals, resultquals = nconc(resultquals,
prefix_quals(leftop, expr_op, prefix_quals(leftop, expr_op,
prefix, pstatus)); prefix, pstatus));
if (prefix)
pfree(prefix);
pfree(patt);
break; break;
case OID_TEXT_REGEXEQ_OP: case OID_TEXT_REGEXEQ_OP:
...@@ -1922,17 +1897,11 @@ expand_indexqual_conditions(List *indexquals) ...@@ -1922,17 +1897,11 @@ expand_indexqual_conditions(List *indexquals)
case OID_VARCHAR_REGEXEQ_OP: case OID_VARCHAR_REGEXEQ_OP:
case OID_NAME_REGEXEQ_OP: case OID_NAME_REGEXEQ_OP:
/* the right-hand const is type text for all of these */ /* the right-hand const is type text for all of these */
constvalue = ((Const *) rightop)->constvalue;
patt = DatumGetCString(DirectFunctionCall1(textout,
constvalue));
pstatus = pattern_fixed_prefix(patt, Pattern_Type_Regex, pstatus = pattern_fixed_prefix(patt, Pattern_Type_Regex,
&prefix, &rest); &prefix, &rest);
resultquals = nconc(resultquals, resultquals = nconc(resultquals,
prefix_quals(leftop, expr_op, prefix_quals(leftop, expr_op,
prefix, pstatus)); prefix, pstatus));
if (prefix)
pfree(prefix);
pfree(patt);
break; break;
case OID_TEXT_ICREGEXEQ_OP: case OID_TEXT_ICREGEXEQ_OP:
...@@ -1940,27 +1909,20 @@ expand_indexqual_conditions(List *indexquals) ...@@ -1940,27 +1909,20 @@ expand_indexqual_conditions(List *indexquals)
case OID_VARCHAR_ICREGEXEQ_OP: case OID_VARCHAR_ICREGEXEQ_OP:
case OID_NAME_ICREGEXEQ_OP: case OID_NAME_ICREGEXEQ_OP:
/* the right-hand const is type text for all of these */ /* the right-hand const is type text for all of these */
constvalue = ((Const *) rightop)->constvalue;
patt = DatumGetCString(DirectFunctionCall1(textout,
constvalue));
pstatus = pattern_fixed_prefix(patt, Pattern_Type_Regex_IC, pstatus = pattern_fixed_prefix(patt, Pattern_Type_Regex_IC,
&prefix, &rest); &prefix, &rest);
resultquals = nconc(resultquals, resultquals = nconc(resultquals,
prefix_quals(leftop, expr_op, prefix_quals(leftop, expr_op,
prefix, pstatus)); prefix, pstatus));
if (prefix)
pfree(prefix);
pfree(patt);
break; break;
case OID_INET_SUB_OP: case OID_INET_SUB_OP:
case OID_INET_SUBEQ_OP: case OID_INET_SUBEQ_OP:
case OID_CIDR_SUB_OP: case OID_CIDR_SUB_OP:
case OID_CIDR_SUBEQ_OP: case OID_CIDR_SUBEQ_OP:
constvalue = ((Const *) rightop)->constvalue;
resultquals = nconc(resultquals, resultquals = nconc(resultquals,
network_prefix_quals(leftop, expr_op, network_prefix_quals(leftop, expr_op,
constvalue)); patt->constvalue));
break; break;
default: default:
...@@ -1980,15 +1942,16 @@ expand_indexqual_conditions(List *indexquals) ...@@ -1980,15 +1942,16 @@ expand_indexqual_conditions(List *indexquals)
*/ */
static List * static List *
prefix_quals(Var *leftop, Oid expr_op, prefix_quals(Var *leftop, Oid expr_op,
char *prefix, Pattern_Prefix_Status pstatus) Const *prefix_const, Pattern_Prefix_Status pstatus)
{ {
List *result; List *result;
Oid datatype; Oid datatype;
Oid oproid; Oid oproid;
char *prefix;
Const *con; Const *con;
Oper *op; Oper *op;
Expr *expr; Expr *expr;
char *greaterstr; Const *greaterstr = NULL;
Assert(pstatus != Pattern_Prefix_None); Assert(pstatus != Pattern_Prefix_None);
...@@ -2001,6 +1964,10 @@ prefix_quals(Var *leftop, Oid expr_op, ...@@ -2001,6 +1964,10 @@ prefix_quals(Var *leftop, Oid expr_op,
datatype = TEXTOID; datatype = TEXTOID;
break; break;
case OID_BYTEA_LIKE_OP:
datatype = BYTEAOID;
break;
case OID_BPCHAR_LIKE_OP: case OID_BPCHAR_LIKE_OP:
case OID_BPCHAR_ICLIKE_OP: case OID_BPCHAR_ICLIKE_OP:
case OID_BPCHAR_REGEXEQ_OP: case OID_BPCHAR_REGEXEQ_OP:
...@@ -2027,6 +1994,11 @@ prefix_quals(Var *leftop, Oid expr_op, ...@@ -2027,6 +1994,11 @@ prefix_quals(Var *leftop, Oid expr_op,
return NIL; return NIL;
} }
if (prefix_const->consttype != BYTEAOID)
prefix = DatumGetCString(DirectFunctionCall1(textout, prefix_const->constvalue));
else
prefix = DatumGetCString(DirectFunctionCall1(byteaout, prefix_const->constvalue));
/* /*
* If we found an exact-match pattern, generate an "=" indexqual. * If we found an exact-match pattern, generate an "=" indexqual.
*/ */
...@@ -2060,17 +2032,15 @@ prefix_quals(Var *leftop, Oid expr_op, ...@@ -2060,17 +2032,15 @@ prefix_quals(Var *leftop, Oid expr_op,
* "x < greaterstr". * "x < greaterstr".
*------- *-------
*/ */
greaterstr = make_greater_string(prefix, datatype); greaterstr = make_greater_string(con);
if (greaterstr) if (greaterstr)
{ {
oproid = find_operator("<", datatype); oproid = find_operator("<", datatype);
if (oproid == InvalidOid) if (oproid == InvalidOid)
elog(ERROR, "prefix_quals: no < operator for type %u", datatype); elog(ERROR, "prefix_quals: no < operator for type %u", datatype);
con = string_to_const(greaterstr, datatype);
op = makeOper(oproid, InvalidOid, BOOLOID, false); op = makeOper(oproid, InvalidOid, BOOLOID, false);
expr = make_opclause(op, leftop, (Var *) con); expr = make_opclause(op, leftop, (Var *) greaterstr);
result = lappend(result, expr); result = lappend(result, expr);
pfree(greaterstr);
} }
return result; return result;
...@@ -2186,6 +2156,8 @@ string_to_datum(const char *str, Oid datatype) ...@@ -2186,6 +2156,8 @@ string_to_datum(const char *str, Oid datatype)
*/ */
if (datatype == NAMEOID) if (datatype == NAMEOID)
return DirectFunctionCall1(namein, CStringGetDatum(str)); return DirectFunctionCall1(namein, CStringGetDatum(str));
else if (datatype == BYTEAOID)
return DirectFunctionCall1(byteain, CStringGetDatum(str));
else else
return DirectFunctionCall1(textin, CStringGetDatum(str)); return DirectFunctionCall1(textin, CStringGetDatum(str));
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/like.c,v 1.51 2002/08/29 07:22:26 ishii Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/like.c,v 1.52 2002/09/02 06:22:19 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -242,7 +242,7 @@ Datum ...@@ -242,7 +242,7 @@ Datum
bytealike(PG_FUNCTION_ARGS) bytealike(PG_FUNCTION_ARGS)
{ {
bytea *str = PG_GETARG_BYTEA_P(0); bytea *str = PG_GETARG_BYTEA_P(0);
text *pat = PG_GETARG_TEXT_P(1); bytea *pat = PG_GETARG_BYTEA_P(1);
bool result; bool result;
unsigned char *s, unsigned char *s,
*p; *p;
...@@ -263,7 +263,7 @@ Datum ...@@ -263,7 +263,7 @@ Datum
byteanlike(PG_FUNCTION_ARGS) byteanlike(PG_FUNCTION_ARGS)
{ {
bytea *str = PG_GETARG_BYTEA_P(0); bytea *str = PG_GETARG_BYTEA_P(0);
text *pat = PG_GETARG_TEXT_P(1); bytea *pat = PG_GETARG_BYTEA_P(1);
bool result; bool result;
unsigned char *s, unsigned char *s,
*p; *p;
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_operator.h,v 1.107 2002/08/22 04:45:11 momjian Exp $ * $Id: pg_operator.h,v 1.108 2002/09/02 06:22:19 momjian Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * the genbki.sh script reads this file and generates .bki
...@@ -827,9 +827,9 @@ DATA(insert OID = 1957 ( "<" PGNSP PGUID b f 17 17 16 1959 1960 0 0 0 0 ...@@ -827,9 +827,9 @@ DATA(insert OID = 1957 ( "<" PGNSP PGUID b f 17 17 16 1959 1960 0 0 0 0
DATA(insert OID = 1958 ( "<=" PGNSP PGUID b f 17 17 16 1960 1959 0 0 0 0 byteale scalarltsel scalarltjoinsel )); DATA(insert OID = 1958 ( "<=" PGNSP PGUID b f 17 17 16 1960 1959 0 0 0 0 byteale scalarltsel scalarltjoinsel ));
DATA(insert OID = 1959 ( ">" PGNSP PGUID b f 17 17 16 1957 1958 0 0 0 0 byteagt scalargtsel scalargtjoinsel )); DATA(insert OID = 1959 ( ">" PGNSP PGUID b f 17 17 16 1957 1958 0 0 0 0 byteagt scalargtsel scalargtjoinsel ));
DATA(insert OID = 1960 ( ">=" PGNSP PGUID b f 17 17 16 1958 1957 0 0 0 0 byteage scalargtsel scalargtjoinsel )); DATA(insert OID = 1960 ( ">=" PGNSP PGUID b f 17 17 16 1958 1957 0 0 0 0 byteage scalargtsel scalargtjoinsel ));
DATA(insert OID = 2016 ( "~~" PGNSP PGUID b f 17 25 16 0 2017 0 0 0 0 bytealike likesel likejoinsel )); DATA(insert OID = 2016 ( "~~" PGNSP PGUID b f 17 17 16 0 2017 0 0 0 0 bytealike likesel likejoinsel ));
#define OID_BYTEA_LIKE_OP 2016 #define OID_BYTEA_LIKE_OP 2016
DATA(insert OID = 2017 ( "!~~" PGNSP PGUID b f 17 25 16 0 2016 0 0 0 0 byteanlike nlikesel nlikejoinsel )); DATA(insert OID = 2017 ( "!~~" PGNSP PGUID b f 17 17 16 0 2016 0 0 0 0 byteanlike nlikesel nlikejoinsel ));
DATA(insert OID = 2018 ( "||" PGNSP PGUID b f 17 17 17 0 0 0 0 0 0 byteacat - - )); DATA(insert OID = 2018 ( "||" PGNSP PGUID b f 17 17 17 0 0 0 0 0 0 byteacat - - ));
/* timestamp operators */ /* timestamp operators */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_proc.h,v 1.267 2002/09/01 00:58:06 tgl Exp $ * $Id: pg_proc.h,v 1.268 2002/09/02 06:22:19 momjian Exp $
* *
* NOTES * NOTES
* The script catalog/genbki.sh reads this file and generates .bki * The script catalog/genbki.sh reads this file and generates .bki
...@@ -2770,13 +2770,13 @@ DESCR("adjust time precision"); ...@@ -2770,13 +2770,13 @@ DESCR("adjust time precision");
DATA(insert OID = 1969 ( timetz PGNSP PGUID 12 f f t f i 2 1266 "1266 23" timetz_scale - _null_ )); DATA(insert OID = 1969 ( timetz PGNSP PGUID 12 f f t f i 2 1266 "1266 23" timetz_scale - _null_ ));
DESCR("adjust time with time zone precision"); DESCR("adjust time with time zone precision");
DATA(insert OID = 2005 ( bytealike PGNSP PGUID 12 f f t f i 2 16 "17 25" bytealike - _null_ )); DATA(insert OID = 2005 ( bytealike PGNSP PGUID 12 f f t f i 2 16 "17 17" bytealike - _null_ ));
DESCR("matches LIKE expression"); DESCR("matches LIKE expression");
DATA(insert OID = 2006 ( byteanlike PGNSP PGUID 12 f f t f i 2 16 "17 25" byteanlike - _null_ )); DATA(insert OID = 2006 ( byteanlike PGNSP PGUID 12 f f t f i 2 16 "17 17" byteanlike - _null_ ));
DESCR("does not match LIKE expression"); DESCR("does not match LIKE expression");
DATA(insert OID = 2007 ( like PGNSP PGUID 12 f f t f i 2 16 "17 25" bytealike - _null_ )); DATA(insert OID = 2007 ( like PGNSP PGUID 12 f f t f i 2 16 "17 17" bytealike - _null_ ));
DESCR("matches LIKE expression"); DESCR("matches LIKE expression");
DATA(insert OID = 2008 ( notlike PGNSP PGUID 12 f f t f i 2 16 "17 25" byteanlike - _null_ )); DATA(insert OID = 2008 ( notlike PGNSP PGUID 12 f f t f i 2 16 "17 17" byteanlike - _null_ ));
DESCR("does not match LIKE expression"); DESCR("does not match LIKE expression");
DATA(insert OID = 2009 ( like_escape PGNSP PGUID 12 f f t f i 2 17 "17 17" like_escape_bytea - _null_ )); DATA(insert OID = 2009 ( like_escape PGNSP PGUID 12 f f t f i 2 17 "17 17" like_escape_bytea - _null_ ));
DESCR("convert match pattern to use backslash escapes"); DESCR("convert match pattern to use backslash escapes");
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: selfuncs.h,v 1.6 2002/06/20 20:29:53 momjian Exp $ * $Id: selfuncs.h,v 1.7 2002/09/02 06:22:20 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -33,12 +33,12 @@ typedef enum ...@@ -33,12 +33,12 @@ typedef enum
/* selfuncs.c */ /* selfuncs.c */
extern Pattern_Prefix_Status pattern_fixed_prefix(char *patt, extern Pattern_Prefix_Status pattern_fixed_prefix(Const *patt,
Pattern_Type ptype, Pattern_Type ptype,
char **prefix, Const **prefix,
char **rest); Const **rest);
extern bool locale_is_like_safe(void); extern bool locale_is_like_safe(void);
extern char *make_greater_string(const char *str, Oid datatype); extern Const *make_greater_string(const Const *str_const);
extern Datum eqsel(PG_FUNCTION_ARGS); extern Datum eqsel(PG_FUNCTION_ARGS);
extern Datum neqsel(PG_FUNCTION_ARGS); extern Datum neqsel(PG_FUNCTION_ARGS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment