bpchar, varchar, bytea, numeric are toastable --- if you initdb, which
I did not force. I marked numeric as compressable-but-not-move-off-able, partly to test that storage mode and partly because I've got doubts that numerics are large enough to need external storage.
This commit is contained in:
parent
20f6a1e562
commit
1ebe1da296
|
@ -7,7 +7,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/commands/trigger.c,v 1.72 2000/07/03 03:57:03 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.73 2000/07/29 03:26:40 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -240,12 +240,14 @@ CreateTrigger(CreateTrigStmt *stmt)
|
||||||
strcat(args, "\\000");
|
strcat(args, "\\000");
|
||||||
}
|
}
|
||||||
values[Anum_pg_trigger_tgnargs - 1] = Int16GetDatum(nargs);
|
values[Anum_pg_trigger_tgnargs - 1] = Int16GetDatum(nargs);
|
||||||
values[Anum_pg_trigger_tgargs - 1] = PointerGetDatum(byteain(args));
|
values[Anum_pg_trigger_tgargs - 1] = DirectFunctionCall1(byteain,
|
||||||
|
CStringGetDatum(args));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
values[Anum_pg_trigger_tgnargs - 1] = Int16GetDatum(0);
|
values[Anum_pg_trigger_tgnargs - 1] = Int16GetDatum(0);
|
||||||
values[Anum_pg_trigger_tgargs - 1] = PointerGetDatum(byteain(""));
|
values[Anum_pg_trigger_tgargs - 1] = DirectFunctionCall1(byteain,
|
||||||
|
CStringGetDatum(""));
|
||||||
}
|
}
|
||||||
MemSet(tgattr, 0, FUNC_MAX_ARGS * sizeof(int16));
|
MemSet(tgattr, 0, FUNC_MAX_ARGS * sizeof(int16));
|
||||||
values[Anum_pg_trigger_tgattr - 1] = PointerGetDatum(tgattr);
|
values[Anum_pg_trigger_tgattr - 1] = PointerGetDatum(tgattr);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* -----------------------------------------------------------------------
|
/* -----------------------------------------------------------------------
|
||||||
* formatting.c
|
* formatting.c
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.19 2000/07/05 23:11:35 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/formatting.c,v 1.20 2000/07/29 03:26:41 tgl Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Portions Copyright (c) 1999-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1999-2000, PostgreSQL, Inc
|
||||||
|
@ -4066,7 +4066,9 @@ numeric_to_char(PG_FUNCTION_ARGS)
|
||||||
x = DatumGetNumeric(DirectFunctionCall2(numeric_round,
|
x = DatumGetNumeric(DirectFunctionCall2(numeric_round,
|
||||||
NumericGetDatum(value),
|
NumericGetDatum(value),
|
||||||
Int32GetDatum(0)));
|
Int32GetDatum(0)));
|
||||||
numstr = orgnum = int_to_roman(numeric_int4(x));
|
numstr = orgnum =
|
||||||
|
int_to_roman(DatumGetInt32(DirectFunctionCall1(numeric_int4,
|
||||||
|
NumericGetDatum(x))));
|
||||||
pfree(x);
|
pfree(x);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -4080,8 +4082,12 @@ numeric_to_char(PG_FUNCTION_ARGS)
|
||||||
Numeric b = DatumGetNumeric(DirectFunctionCall1(int4_numeric,
|
Numeric b = DatumGetNumeric(DirectFunctionCall1(int4_numeric,
|
||||||
Int32GetDatum(Num.multi)));
|
Int32GetDatum(Num.multi)));
|
||||||
|
|
||||||
x = numeric_power(a, b);
|
x = DatumGetNumeric(DirectFunctionCall2(numeric_power,
|
||||||
val = numeric_mul(value, x);
|
NumericGetDatum(a),
|
||||||
|
NumericGetDatum(b)));
|
||||||
|
val = DatumGetNumeric(DirectFunctionCall2(numeric_mul,
|
||||||
|
NumericGetDatum(value),
|
||||||
|
NumericGetDatum(x)));
|
||||||
pfree(x);
|
pfree(x);
|
||||||
pfree(a);
|
pfree(a);
|
||||||
pfree(b);
|
pfree(b);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -15,7 +15,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.75 2000/07/06 05:48:11 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.76 2000/07/29 03:26:42 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -818,7 +818,8 @@ convert_numeric_to_scalar(Datum value, Oid typid)
|
||||||
case FLOAT8OID:
|
case FLOAT8OID:
|
||||||
return (double) DatumGetFloat8(value);
|
return (double) DatumGetFloat8(value);
|
||||||
case NUMERICOID:
|
case NUMERICOID:
|
||||||
return (double) (*numeric_float8((Numeric) DatumGetPointer(value)));
|
return (double) DatumGetFloat8(DirectFunctionCall1(numeric_float8,
|
||||||
|
value));
|
||||||
case OIDOID:
|
case OIDOID:
|
||||||
case REGPROCOID:
|
case REGPROCOID:
|
||||||
/* we can treat OIDs as integers... */
|
/* we can treat OIDs as integers... */
|
||||||
|
@ -1825,11 +1826,13 @@ string_lessthan(const char *str1, const char *str2, Oid datatype)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BPCHAROID:
|
case BPCHAROID:
|
||||||
result = bpcharlt((char *) datum1, (char *) datum2);
|
result = DatumGetBool(DirectFunctionCall2(bpcharlt,
|
||||||
|
datum1, datum2));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VARCHAROID:
|
case VARCHAROID:
|
||||||
result = varcharlt((char *) datum1, (char *) datum2);
|
result = DatumGetBool(DirectFunctionCall2(varcharlt,
|
||||||
|
datum1, datum2));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAMEOID:
|
case NAMEOID:
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.68 2000/07/07 21:12:50 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.69 2000/07/29 03:26:42 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -260,19 +260,20 @@ char_bpchar(PG_FUNCTION_ARGS)
|
||||||
/* bpchar_name()
|
/* bpchar_name()
|
||||||
* Converts a bpchar() type to a NameData type.
|
* Converts a bpchar() type to a NameData type.
|
||||||
*/
|
*/
|
||||||
NameData *
|
Datum
|
||||||
bpchar_name(char *s)
|
bpchar_name(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
NameData *result;
|
BpChar *s = PG_GETARG_BPCHAR_P(0);
|
||||||
|
Name result;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if (s == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
len = VARSIZE(s) - VARHDRSZ;
|
len = VARSIZE(s) - VARHDRSZ;
|
||||||
|
|
||||||
|
/* Truncate to max length for a Name */
|
||||||
if (len >= NAMEDATALEN)
|
if (len >= NAMEDATALEN)
|
||||||
len = NAMEDATALEN-1;
|
len = NAMEDATALEN-1;
|
||||||
|
|
||||||
|
/* Remove trailing blanks */
|
||||||
while (len > 0)
|
while (len > 0)
|
||||||
{
|
{
|
||||||
if (*(VARDATA(s) + len - 1) != ' ')
|
if (*(VARDATA(s) + len - 1) != ' ')
|
||||||
|
@ -280,49 +281,36 @@ bpchar_name(char *s)
|
||||||
len--;
|
len--;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef STRINGDEBUG
|
|
||||||
printf("bpchar- convert string length %d (%d) ->%d\n",
|
|
||||||
VARSIZE(s) - VARHDRSZ, VARSIZE(s), len);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
result = (NameData *) palloc(NAMEDATALEN);
|
result = (NameData *) palloc(NAMEDATALEN);
|
||||||
memcpy(NameStr(*result), VARDATA(s), len);
|
memcpy(NameStr(*result), VARDATA(s), len);
|
||||||
|
|
||||||
/* now null pad to full length... */
|
/* Now null pad to full length... */
|
||||||
while (len < NAMEDATALEN)
|
while (len < NAMEDATALEN)
|
||||||
{
|
{
|
||||||
*(NameStr(*result) + len) = '\0';
|
*(NameStr(*result) + len) = '\0';
|
||||||
len++;
|
len++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
PG_RETURN_NAME(result);
|
||||||
} /* bpchar_name() */
|
}
|
||||||
|
|
||||||
/* name_bpchar()
|
/* name_bpchar()
|
||||||
* Converts a NameData type to a bpchar type.
|
* Converts a NameData type to a bpchar type.
|
||||||
*/
|
*/
|
||||||
char *
|
Datum
|
||||||
name_bpchar(NameData *s)
|
name_bpchar(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
char *result;
|
Name s = PG_GETARG_NAME(0);
|
||||||
|
BpChar *result;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if (s == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
len = strlen(NameStr(*s));
|
len = strlen(NameStr(*s));
|
||||||
|
result = (BpChar *) palloc(VARHDRSZ + len);
|
||||||
#ifdef STRINGDEBUG
|
|
||||||
printf("bpchar- convert string length %d (%d) ->%d\n",
|
|
||||||
VARSIZE(s) - VARHDRSZ, VARSIZE(s), len);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
result = (char *) palloc(VARHDRSZ + len);
|
|
||||||
memcpy(VARDATA(result), NameStr(*s), len);
|
memcpy(VARDATA(result), NameStr(*s), len);
|
||||||
VARATT_SIZEP(result) = len + VARHDRSZ;
|
VARATT_SIZEP(result) = len + VARHDRSZ;
|
||||||
|
|
||||||
return result;
|
PG_RETURN_BPCHAR_P(result);
|
||||||
} /* name_bpchar() */
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
@ -446,13 +434,9 @@ _varchar(PG_FUNCTION_ARGS)
|
||||||
return array_map(&locfcinfo, VARCHAROID, VARCHAROID);
|
return array_map(&locfcinfo, VARCHAROID, VARCHAROID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* "True" length (not counting trailing blanks) of a BpChar */
|
||||||
/*****************************************************************************
|
|
||||||
* Comparison Functions used for bpchar
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bcTruelen(char *arg)
|
bcTruelen(BpChar *arg)
|
||||||
{
|
{
|
||||||
char *s = VARDATA(arg);
|
char *s = VARDATA(arg);
|
||||||
int i;
|
int i;
|
||||||
|
@ -467,19 +451,16 @@ bcTruelen(char *arg)
|
||||||
return i + 1;
|
return i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32
|
Datum
|
||||||
bpcharlen(char *arg)
|
bpcharlen(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
|
BpChar *arg = PG_GETARG_BPCHAR_P(0);
|
||||||
#ifdef MULTIBYTE
|
#ifdef MULTIBYTE
|
||||||
unsigned char *s;
|
unsigned char *s;
|
||||||
int len,
|
int len,
|
||||||
l,
|
l,
|
||||||
wl;
|
wl;
|
||||||
|
|
||||||
#endif
|
|
||||||
if (!PointerIsValid(arg))
|
|
||||||
elog(ERROR, "Bad (null) char() external representation");
|
|
||||||
#ifdef MULTIBYTE
|
|
||||||
l = VARSIZE(arg) - VARHDRSZ;
|
l = VARSIZE(arg) - VARHDRSZ;
|
||||||
len = 0;
|
len = 0;
|
||||||
s = VARDATA(arg);
|
s = VARDATA(arg);
|
||||||
|
@ -490,318 +471,176 @@ bpcharlen(char *arg)
|
||||||
s += wl;
|
s += wl;
|
||||||
len++;
|
len++;
|
||||||
}
|
}
|
||||||
return (len);
|
PG_RETURN_INT32(len);
|
||||||
#else
|
#else
|
||||||
return (VARSIZE(arg) - VARHDRSZ);
|
PG_RETURN_INT32(VARSIZE(arg) - VARHDRSZ);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int32
|
Datum
|
||||||
bpcharoctetlen(char *arg)
|
bpcharoctetlen(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
if (!PointerIsValid(arg))
|
BpChar *arg = PG_GETARG_BPCHAR_P(0);
|
||||||
elog(ERROR, "Bad (null) char() external representation");
|
|
||||||
|
|
||||||
return (VARSIZE(arg) - VARHDRSZ);
|
PG_RETURN_INT32(VARSIZE(arg) - VARHDRSZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
bpchareq(char *arg1, char *arg2)
|
|
||||||
{
|
|
||||||
int len1,
|
|
||||||
len2;
|
|
||||||
|
|
||||||
if (arg1 == NULL || arg2 == NULL)
|
|
||||||
return (bool) 0;
|
|
||||||
len1 = bcTruelen(arg1);
|
|
||||||
len2 = bcTruelen(arg2);
|
|
||||||
|
|
||||||
if (len1 != len2)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return strncmp(VARDATA(arg1), VARDATA(arg2), len1) == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
bpcharne(char *arg1, char *arg2)
|
|
||||||
{
|
|
||||||
int len1,
|
|
||||||
len2;
|
|
||||||
|
|
||||||
if (arg1 == NULL || arg2 == NULL)
|
|
||||||
return (bool) 0;
|
|
||||||
len1 = bcTruelen(arg1);
|
|
||||||
len2 = bcTruelen(arg2);
|
|
||||||
|
|
||||||
if (len1 != len2)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
return strncmp(VARDATA(arg1), VARDATA(arg2), len1) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
bpcharlt(char *arg1, char *arg2)
|
|
||||||
{
|
|
||||||
int len1,
|
|
||||||
len2;
|
|
||||||
int cmp;
|
|
||||||
|
|
||||||
if (arg1 == NULL || arg2 == NULL)
|
|
||||||
return (bool) 0;
|
|
||||||
len1 = bcTruelen(arg1);
|
|
||||||
len2 = bcTruelen(arg2);
|
|
||||||
|
|
||||||
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
|
||||||
if (cmp == 0)
|
|
||||||
return len1 < len2;
|
|
||||||
else
|
|
||||||
return cmp < 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
bpcharle(char *arg1, char *arg2)
|
|
||||||
{
|
|
||||||
int len1,
|
|
||||||
len2;
|
|
||||||
int cmp;
|
|
||||||
|
|
||||||
if (arg1 == NULL || arg2 == NULL)
|
|
||||||
return (bool) 0;
|
|
||||||
len1 = bcTruelen(arg1);
|
|
||||||
len2 = bcTruelen(arg2);
|
|
||||||
|
|
||||||
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
|
||||||
if (0 == cmp)
|
|
||||||
return (bool) (len1 <= len2 ? 1 : 0);
|
|
||||||
else
|
|
||||||
return (bool) (cmp <= 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
bpchargt(char *arg1, char *arg2)
|
|
||||||
{
|
|
||||||
int len1,
|
|
||||||
len2;
|
|
||||||
int cmp;
|
|
||||||
|
|
||||||
if (arg1 == NULL || arg2 == NULL)
|
|
||||||
return (bool) 0;
|
|
||||||
len1 = bcTruelen(arg1);
|
|
||||||
len2 = bcTruelen(arg2);
|
|
||||||
|
|
||||||
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
|
||||||
if (cmp == 0)
|
|
||||||
return len1 > len2;
|
|
||||||
else
|
|
||||||
return cmp > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
bpcharge(char *arg1, char *arg2)
|
|
||||||
{
|
|
||||||
int len1,
|
|
||||||
len2;
|
|
||||||
int cmp;
|
|
||||||
|
|
||||||
if (arg1 == NULL || arg2 == NULL)
|
|
||||||
return (bool) 0;
|
|
||||||
len1 = bcTruelen(arg1);
|
|
||||||
len2 = bcTruelen(arg2);
|
|
||||||
|
|
||||||
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
|
||||||
if (0 == cmp)
|
|
||||||
return (bool) (len1 >= len2 ? 1 : 0);
|
|
||||||
else
|
|
||||||
return (bool) (cmp >= 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int32
|
|
||||||
bpcharcmp(char *arg1, char *arg2)
|
|
||||||
{
|
|
||||||
int len1,
|
|
||||||
len2;
|
|
||||||
int cmp;
|
|
||||||
|
|
||||||
len1 = bcTruelen(arg1);
|
|
||||||
len2 = bcTruelen(arg2);
|
|
||||||
|
|
||||||
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
|
||||||
if ((0 == cmp) && (len1 != len2))
|
|
||||||
return (int32) (len1 < len2 ? -1 : 1);
|
|
||||||
else
|
|
||||||
return cmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Comparison Functions used for varchar
|
* Comparison Functions used for bpchar
|
||||||
|
*
|
||||||
|
* Note: btree indexes need these routines not to leak memory; therefore,
|
||||||
|
* be careful to free working copies of toasted datums. Most places don't
|
||||||
|
* need to be so careful.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
int32
|
Datum
|
||||||
varcharlen(char *arg)
|
bpchareq(PG_FUNCTION_ARGS)
|
||||||
{
|
|
||||||
#ifdef MULTIBYTE
|
|
||||||
unsigned char *s;
|
|
||||||
int len,
|
|
||||||
l,
|
|
||||||
wl;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
if (!PointerIsValid(arg))
|
|
||||||
elog(ERROR, "Bad (null) varchar() external representation");
|
|
||||||
|
|
||||||
#ifdef MULTIBYTE
|
|
||||||
len = 0;
|
|
||||||
s = VARDATA(arg);
|
|
||||||
l = VARSIZE(arg) - VARHDRSZ;
|
|
||||||
while (l > 0)
|
|
||||||
{
|
|
||||||
wl = pg_mblen(s);
|
|
||||||
l -= wl;
|
|
||||||
s += wl;
|
|
||||||
len++;
|
|
||||||
}
|
|
||||||
return (len);
|
|
||||||
#else
|
|
||||||
return VARSIZE(arg) - VARHDRSZ;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
int32
|
|
||||||
varcharoctetlen(char *arg)
|
|
||||||
{
|
|
||||||
if (!PointerIsValid(arg))
|
|
||||||
elog(ERROR, "Bad (null) varchar() external representation");
|
|
||||||
return VARSIZE(arg) - VARHDRSZ;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
varchareq(char *arg1, char *arg2)
|
|
||||||
{
|
{
|
||||||
|
BpChar *arg1 = PG_GETARG_BPCHAR_P(0);
|
||||||
|
BpChar *arg2 = PG_GETARG_BPCHAR_P(1);
|
||||||
int len1,
|
int len1,
|
||||||
len2;
|
len2;
|
||||||
|
bool result;
|
||||||
|
|
||||||
if (arg1 == NULL || arg2 == NULL)
|
len1 = bcTruelen(arg1);
|
||||||
return (bool) 0;
|
len2 = bcTruelen(arg2);
|
||||||
|
|
||||||
len1 = VARSIZE(arg1) - VARHDRSZ;
|
|
||||||
len2 = VARSIZE(arg2) - VARHDRSZ;
|
|
||||||
|
|
||||||
if (len1 != len2)
|
if (len1 != len2)
|
||||||
return 0;
|
result = false;
|
||||||
|
else
|
||||||
|
result = (strncmp(VARDATA(arg1), VARDATA(arg2), len1) == 0);
|
||||||
|
|
||||||
return strncmp(VARDATA(arg1), VARDATA(arg2), len1) == 0;
|
PG_FREE_IF_COPY(arg1, 0);
|
||||||
|
PG_FREE_IF_COPY(arg2, 1);
|
||||||
|
|
||||||
|
PG_RETURN_BOOL(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
Datum
|
||||||
varcharne(char *arg1, char *arg2)
|
bpcharne(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
|
BpChar *arg1 = PG_GETARG_BPCHAR_P(0);
|
||||||
|
BpChar *arg2 = PG_GETARG_BPCHAR_P(1);
|
||||||
int len1,
|
int len1,
|
||||||
len2;
|
len2;
|
||||||
|
bool result;
|
||||||
|
|
||||||
if (arg1 == NULL || arg2 == NULL)
|
len1 = bcTruelen(arg1);
|
||||||
return (bool) 0;
|
len2 = bcTruelen(arg2);
|
||||||
len1 = VARSIZE(arg1) - VARHDRSZ;
|
|
||||||
len2 = VARSIZE(arg2) - VARHDRSZ;
|
|
||||||
|
|
||||||
if (len1 != len2)
|
if (len1 != len2)
|
||||||
return 1;
|
result = true;
|
||||||
|
else
|
||||||
|
result = (strncmp(VARDATA(arg1), VARDATA(arg2), len1) != 0);
|
||||||
|
|
||||||
return strncmp(VARDATA(arg1), VARDATA(arg2), len1) != 0;
|
PG_FREE_IF_COPY(arg1, 0);
|
||||||
|
PG_FREE_IF_COPY(arg2, 1);
|
||||||
|
|
||||||
|
PG_RETURN_BOOL(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
Datum
|
||||||
varcharlt(char *arg1, char *arg2)
|
bpcharlt(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
|
BpChar *arg1 = PG_GETARG_BPCHAR_P(0);
|
||||||
|
BpChar *arg2 = PG_GETARG_BPCHAR_P(1);
|
||||||
int len1,
|
int len1,
|
||||||
len2;
|
len2;
|
||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
if (arg1 == NULL || arg2 == NULL)
|
len1 = bcTruelen(arg1);
|
||||||
return (bool) 0;
|
len2 = bcTruelen(arg2);
|
||||||
len1 = VARSIZE(arg1) - VARHDRSZ;
|
|
||||||
len2 = VARSIZE(arg2) - VARHDRSZ;
|
|
||||||
|
|
||||||
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
||||||
if (cmp == 0)
|
|
||||||
return len1 < len2;
|
PG_FREE_IF_COPY(arg1, 0);
|
||||||
else
|
PG_FREE_IF_COPY(arg2, 1);
|
||||||
return cmp < 0;
|
|
||||||
|
PG_RETURN_BOOL(cmp < 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
Datum
|
||||||
varcharle(char *arg1, char *arg2)
|
bpcharle(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
|
BpChar *arg1 = PG_GETARG_BPCHAR_P(0);
|
||||||
|
BpChar *arg2 = PG_GETARG_BPCHAR_P(1);
|
||||||
int len1,
|
int len1,
|
||||||
len2;
|
len2;
|
||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
if (arg1 == NULL || arg2 == NULL)
|
len1 = bcTruelen(arg1);
|
||||||
return (bool) 0;
|
len2 = bcTruelen(arg2);
|
||||||
len1 = VARSIZE(arg1) - VARHDRSZ;
|
|
||||||
len2 = VARSIZE(arg2) - VARHDRSZ;
|
|
||||||
|
|
||||||
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
||||||
if (0 == cmp)
|
|
||||||
return (bool) (len1 <= len2 ? 1 : 0);
|
PG_FREE_IF_COPY(arg1, 0);
|
||||||
else
|
PG_FREE_IF_COPY(arg2, 1);
|
||||||
return (bool) (cmp <= 0);
|
|
||||||
|
PG_RETURN_BOOL(cmp <= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
Datum
|
||||||
varchargt(char *arg1, char *arg2)
|
bpchargt(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
|
BpChar *arg1 = PG_GETARG_BPCHAR_P(0);
|
||||||
|
BpChar *arg2 = PG_GETARG_BPCHAR_P(1);
|
||||||
int len1,
|
int len1,
|
||||||
len2;
|
len2;
|
||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
if (arg1 == NULL || arg2 == NULL)
|
len1 = bcTruelen(arg1);
|
||||||
return (bool) 0;
|
len2 = bcTruelen(arg2);
|
||||||
len1 = VARSIZE(arg1) - VARHDRSZ;
|
|
||||||
len2 = VARSIZE(arg2) - VARHDRSZ;
|
|
||||||
|
|
||||||
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
||||||
if (cmp == 0)
|
|
||||||
return len1 > len2;
|
PG_FREE_IF_COPY(arg1, 0);
|
||||||
else
|
PG_FREE_IF_COPY(arg2, 1);
|
||||||
return cmp > 0;
|
|
||||||
|
PG_RETURN_BOOL(cmp > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
Datum
|
||||||
varcharge(char *arg1, char *arg2)
|
bpcharge(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
|
BpChar *arg1 = PG_GETARG_BPCHAR_P(0);
|
||||||
|
BpChar *arg2 = PG_GETARG_BPCHAR_P(1);
|
||||||
int len1,
|
int len1,
|
||||||
len2;
|
len2;
|
||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
if (arg1 == NULL || arg2 == NULL)
|
len1 = bcTruelen(arg1);
|
||||||
return (bool) 0;
|
len2 = bcTruelen(arg2);
|
||||||
len1 = VARSIZE(arg1) - VARHDRSZ;
|
|
||||||
len2 = VARSIZE(arg2) - VARHDRSZ;
|
|
||||||
|
|
||||||
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
||||||
if (0 == cmp)
|
|
||||||
return (bool) (len1 >= len2 ? 1 : 0);
|
|
||||||
else
|
|
||||||
return (bool) (cmp >= 0);
|
|
||||||
|
|
||||||
|
PG_FREE_IF_COPY(arg1, 0);
|
||||||
|
PG_FREE_IF_COPY(arg2, 1);
|
||||||
|
|
||||||
|
PG_RETURN_BOOL(cmp >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32
|
Datum
|
||||||
varcharcmp(char *arg1, char *arg2)
|
bpcharcmp(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
|
BpChar *arg1 = PG_GETARG_BPCHAR_P(0);
|
||||||
|
BpChar *arg2 = PG_GETARG_BPCHAR_P(1);
|
||||||
int len1,
|
int len1,
|
||||||
len2;
|
len2;
|
||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
len1 = VARSIZE(arg1) - VARHDRSZ;
|
len1 = bcTruelen(arg1);
|
||||||
len2 = VARSIZE(arg2) - VARHDRSZ;
|
len2 = bcTruelen(arg2);
|
||||||
|
|
||||||
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
||||||
if ((0 == cmp) && (len1 != len2))
|
|
||||||
return (int32) (len1 < len2 ? -1 : 1);
|
PG_FREE_IF_COPY(arg1, 0);
|
||||||
else
|
PG_FREE_IF_COPY(arg2, 1);
|
||||||
return (int32) (cmp);
|
|
||||||
|
PG_RETURN_INT32(cmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* bpchar needs a specialized hash function because we want to ignore
|
* bpchar needs a specialized hash function because we want to ignore
|
||||||
* trailing blanks in comparisons. (varchar can use plain hashvarlena.)
|
* trailing blanks in comparisons. (varchar can use plain hashvarlena.)
|
||||||
|
@ -814,7 +653,201 @@ hashbpchar(PG_FUNCTION_ARGS)
|
||||||
int keylen;
|
int keylen;
|
||||||
|
|
||||||
keydata = VARDATA(key);
|
keydata = VARDATA(key);
|
||||||
keylen = bcTruelen((char *) key);
|
keylen = bcTruelen(key);
|
||||||
|
|
||||||
return hash_any(keydata, keylen);
|
return hash_any(keydata, keylen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Functions used for varchar
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
Datum
|
||||||
|
varcharlen(PG_FUNCTION_ARGS)
|
||||||
|
{
|
||||||
|
VarChar *arg = PG_GETARG_VARCHAR_P(0);
|
||||||
|
#ifdef MULTIBYTE
|
||||||
|
unsigned char *s;
|
||||||
|
int len,
|
||||||
|
l,
|
||||||
|
wl;
|
||||||
|
|
||||||
|
len = 0;
|
||||||
|
s = VARDATA(arg);
|
||||||
|
l = VARSIZE(arg) - VARHDRSZ;
|
||||||
|
while (l > 0)
|
||||||
|
{
|
||||||
|
wl = pg_mblen(s);
|
||||||
|
l -= wl;
|
||||||
|
s += wl;
|
||||||
|
len++;
|
||||||
|
}
|
||||||
|
PG_RETURN_INT32(len);
|
||||||
|
#else
|
||||||
|
PG_RETURN_INT32(VARSIZE(arg) - VARHDRSZ);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
Datum
|
||||||
|
varcharoctetlen(PG_FUNCTION_ARGS)
|
||||||
|
{
|
||||||
|
VarChar *arg = PG_GETARG_VARCHAR_P(0);
|
||||||
|
|
||||||
|
PG_RETURN_INT32(VARSIZE(arg) - VARHDRSZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Comparison Functions used for varchar
|
||||||
|
*
|
||||||
|
* Note: btree indexes need these routines not to leak memory; therefore,
|
||||||
|
* be careful to free working copies of toasted datums. Most places don't
|
||||||
|
* need to be so careful.
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
Datum
|
||||||
|
varchareq(PG_FUNCTION_ARGS)
|
||||||
|
{
|
||||||
|
VarChar *arg1 = PG_GETARG_VARCHAR_P(0);
|
||||||
|
VarChar *arg2 = PG_GETARG_VARCHAR_P(1);
|
||||||
|
int len1,
|
||||||
|
len2;
|
||||||
|
bool result;
|
||||||
|
|
||||||
|
len1 = VARSIZE(arg1) - VARHDRSZ;
|
||||||
|
len2 = VARSIZE(arg2) - VARHDRSZ;
|
||||||
|
|
||||||
|
if (len1 != len2)
|
||||||
|
result = false;
|
||||||
|
else
|
||||||
|
result = (strncmp(VARDATA(arg1), VARDATA(arg2), len1) == 0);
|
||||||
|
|
||||||
|
PG_FREE_IF_COPY(arg1, 0);
|
||||||
|
PG_FREE_IF_COPY(arg2, 1);
|
||||||
|
|
||||||
|
PG_RETURN_BOOL(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
Datum
|
||||||
|
varcharne(PG_FUNCTION_ARGS)
|
||||||
|
{
|
||||||
|
VarChar *arg1 = PG_GETARG_VARCHAR_P(0);
|
||||||
|
VarChar *arg2 = PG_GETARG_VARCHAR_P(1);
|
||||||
|
int len1,
|
||||||
|
len2;
|
||||||
|
bool result;
|
||||||
|
|
||||||
|
len1 = VARSIZE(arg1) - VARHDRSZ;
|
||||||
|
len2 = VARSIZE(arg2) - VARHDRSZ;
|
||||||
|
|
||||||
|
if (len1 != len2)
|
||||||
|
result = true;
|
||||||
|
else
|
||||||
|
result = (strncmp(VARDATA(arg1), VARDATA(arg2), len1) != 0);
|
||||||
|
|
||||||
|
PG_FREE_IF_COPY(arg1, 0);
|
||||||
|
PG_FREE_IF_COPY(arg2, 1);
|
||||||
|
|
||||||
|
PG_RETURN_BOOL(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
Datum
|
||||||
|
varcharlt(PG_FUNCTION_ARGS)
|
||||||
|
{
|
||||||
|
VarChar *arg1 = PG_GETARG_VARCHAR_P(0);
|
||||||
|
VarChar *arg2 = PG_GETARG_VARCHAR_P(1);
|
||||||
|
int len1,
|
||||||
|
len2;
|
||||||
|
int cmp;
|
||||||
|
|
||||||
|
len1 = VARSIZE(arg1) - VARHDRSZ;
|
||||||
|
len2 = VARSIZE(arg2) - VARHDRSZ;
|
||||||
|
|
||||||
|
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
||||||
|
|
||||||
|
PG_FREE_IF_COPY(arg1, 0);
|
||||||
|
PG_FREE_IF_COPY(arg2, 1);
|
||||||
|
|
||||||
|
PG_RETURN_BOOL(cmp < 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Datum
|
||||||
|
varcharle(PG_FUNCTION_ARGS)
|
||||||
|
{
|
||||||
|
VarChar *arg1 = PG_GETARG_VARCHAR_P(0);
|
||||||
|
VarChar *arg2 = PG_GETARG_VARCHAR_P(1);
|
||||||
|
int len1,
|
||||||
|
len2;
|
||||||
|
int cmp;
|
||||||
|
|
||||||
|
len1 = VARSIZE(arg1) - VARHDRSZ;
|
||||||
|
len2 = VARSIZE(arg2) - VARHDRSZ;
|
||||||
|
|
||||||
|
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
||||||
|
|
||||||
|
PG_FREE_IF_COPY(arg1, 0);
|
||||||
|
PG_FREE_IF_COPY(arg2, 1);
|
||||||
|
|
||||||
|
PG_RETURN_BOOL(cmp <= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Datum
|
||||||
|
varchargt(PG_FUNCTION_ARGS)
|
||||||
|
{
|
||||||
|
VarChar *arg1 = PG_GETARG_VARCHAR_P(0);
|
||||||
|
VarChar *arg2 = PG_GETARG_VARCHAR_P(1);
|
||||||
|
int len1,
|
||||||
|
len2;
|
||||||
|
int cmp;
|
||||||
|
|
||||||
|
len1 = VARSIZE(arg1) - VARHDRSZ;
|
||||||
|
len2 = VARSIZE(arg2) - VARHDRSZ;
|
||||||
|
|
||||||
|
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
||||||
|
|
||||||
|
PG_FREE_IF_COPY(arg1, 0);
|
||||||
|
PG_FREE_IF_COPY(arg2, 1);
|
||||||
|
|
||||||
|
PG_RETURN_BOOL(cmp > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Datum
|
||||||
|
varcharge(PG_FUNCTION_ARGS)
|
||||||
|
{
|
||||||
|
VarChar *arg1 = PG_GETARG_VARCHAR_P(0);
|
||||||
|
VarChar *arg2 = PG_GETARG_VARCHAR_P(1);
|
||||||
|
int len1,
|
||||||
|
len2;
|
||||||
|
int cmp;
|
||||||
|
|
||||||
|
len1 = VARSIZE(arg1) - VARHDRSZ;
|
||||||
|
len2 = VARSIZE(arg2) - VARHDRSZ;
|
||||||
|
|
||||||
|
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
||||||
|
|
||||||
|
PG_FREE_IF_COPY(arg1, 0);
|
||||||
|
PG_FREE_IF_COPY(arg2, 1);
|
||||||
|
|
||||||
|
PG_RETURN_BOOL(cmp >= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Datum
|
||||||
|
varcharcmp(PG_FUNCTION_ARGS)
|
||||||
|
{
|
||||||
|
VarChar *arg1 = PG_GETARG_VARCHAR_P(0);
|
||||||
|
VarChar *arg2 = PG_GETARG_VARCHAR_P(1);
|
||||||
|
int len1,
|
||||||
|
len2;
|
||||||
|
int cmp;
|
||||||
|
|
||||||
|
len1 = VARSIZE(arg1) - VARHDRSZ;
|
||||||
|
len2 = VARSIZE(arg2) - VARHDRSZ;
|
||||||
|
|
||||||
|
cmp = varstr_cmp(VARDATA(arg1), len1, VARDATA(arg2), len2);
|
||||||
|
|
||||||
|
PG_FREE_IF_COPY(arg1, 0);
|
||||||
|
PG_FREE_IF_COPY(arg2, 1);
|
||||||
|
|
||||||
|
PG_RETURN_INT32(cmp);
|
||||||
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.64 2000/07/12 02:37:19 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.65 2000/07/29 03:26:42 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -41,18 +41,17 @@ static int text_cmp(text *arg1, text *arg2);
|
||||||
* The input is scaned twice.
|
* The input is scaned twice.
|
||||||
* The error checking of input is minimal.
|
* The error checking of input is minimal.
|
||||||
*/
|
*/
|
||||||
bytea *
|
Datum
|
||||||
byteain(char *inputText)
|
byteain(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
|
char *inputText = PG_GETARG_CSTRING(0);
|
||||||
char *tp;
|
char *tp;
|
||||||
char *rp;
|
char *rp;
|
||||||
int byte;
|
int byte;
|
||||||
bytea *result;
|
bytea *result;
|
||||||
|
|
||||||
if (inputText == NULL)
|
|
||||||
elog(ERROR, "Bad input string for type bytea");
|
|
||||||
|
|
||||||
for (byte = 0, tp = inputText; *tp != '\0'; byte++)
|
for (byte = 0, tp = inputText; *tp != '\0'; byte++)
|
||||||
|
{
|
||||||
if (*tp++ == '\\')
|
if (*tp++ == '\\')
|
||||||
{
|
{
|
||||||
if (*tp == '\\')
|
if (*tp == '\\')
|
||||||
|
@ -62,12 +61,16 @@ byteain(char *inputText)
|
||||||
!isdigit((int) *tp++))
|
!isdigit((int) *tp++))
|
||||||
elog(ERROR, "Bad input string for type bytea");
|
elog(ERROR, "Bad input string for type bytea");
|
||||||
}
|
}
|
||||||
tp = inputText;
|
}
|
||||||
|
|
||||||
byte += VARHDRSZ;
|
byte += VARHDRSZ;
|
||||||
result = (bytea *) palloc(byte);
|
result = (bytea *) palloc(byte);
|
||||||
result->vl_len = byte; /* varlena? */
|
result->vl_len = byte; /* set varlena length */
|
||||||
|
|
||||||
|
tp = inputText;
|
||||||
rp = result->vl_dat;
|
rp = result->vl_dat;
|
||||||
while (*tp != '\0')
|
while (*tp != '\0')
|
||||||
|
{
|
||||||
if (*tp != '\\' || *++tp == '\\')
|
if (*tp != '\\' || *++tp == '\\')
|
||||||
*rp++ = *tp++;
|
*rp++ = *tp++;
|
||||||
else
|
else
|
||||||
|
@ -78,7 +81,9 @@ byteain(char *inputText)
|
||||||
byte <<= 3;
|
byte <<= 3;
|
||||||
*rp++ = byte + VAL(*tp++);
|
*rp++ = byte + VAL(*tp++);
|
||||||
}
|
}
|
||||||
return result;
|
}
|
||||||
|
|
||||||
|
PG_RETURN_BYTEA_P(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -89,9 +94,10 @@ byteain(char *inputText)
|
||||||
*
|
*
|
||||||
* NULL vlena should be an error--returning string with NULL for now.
|
* NULL vlena should be an error--returning string with NULL for now.
|
||||||
*/
|
*/
|
||||||
char *
|
Datum
|
||||||
byteaout(bytea *vlena)
|
byteaout(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
|
bytea *vlena = PG_GETARG_BYTEA_P(0);
|
||||||
char *result;
|
char *result;
|
||||||
char *vp;
|
char *vp;
|
||||||
char *rp;
|
char *rp;
|
||||||
|
@ -99,47 +105,42 @@ byteaout(bytea *vlena)
|
||||||
int i;
|
int i;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if (vlena == NULL)
|
|
||||||
{
|
|
||||||
result = (char *) palloc(2);
|
|
||||||
result[0] = '-';
|
|
||||||
result[1] = '\0';
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
vp = vlena->vl_dat;
|
|
||||||
len = 1; /* empty string has 1 char */
|
len = 1; /* empty string has 1 char */
|
||||||
|
vp = vlena->vl_dat;
|
||||||
for (i = vlena->vl_len - VARHDRSZ; i != 0; i--, vp++)
|
for (i = vlena->vl_len - VARHDRSZ; i != 0; i--, vp++)
|
||||||
|
{
|
||||||
if (*vp == '\\')
|
if (*vp == '\\')
|
||||||
len += 2;
|
len += 2;
|
||||||
else if (isascii((int) *vp) && isprint((int) *vp))
|
else if (isascii((int) *vp) && isprint((int) *vp))
|
||||||
len++;
|
len++;
|
||||||
else
|
else
|
||||||
len += VARHDRSZ;
|
len += 4;
|
||||||
|
}
|
||||||
rp = result = (char *) palloc(len);
|
rp = result = (char *) palloc(len);
|
||||||
vp = vlena->vl_dat;
|
vp = vlena->vl_dat;
|
||||||
for (i = vlena->vl_len - VARHDRSZ; i != 0; i--)
|
for (i = vlena->vl_len - VARHDRSZ; i != 0; i--, vp++)
|
||||||
|
{
|
||||||
if (*vp == '\\')
|
if (*vp == '\\')
|
||||||
{
|
{
|
||||||
vp++;
|
|
||||||
*rp++ = '\\';
|
*rp++ = '\\';
|
||||||
*rp++ = '\\';
|
*rp++ = '\\';
|
||||||
}
|
}
|
||||||
else if (isascii((int) *vp) && isprint((int) *vp))
|
else if (isascii((int) *vp) && isprint((int) *vp))
|
||||||
*rp++ = *vp++;
|
*rp++ = *vp;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
val = *vp++;
|
val = *vp;
|
||||||
*rp = '\\';
|
rp[0] = '\\';
|
||||||
rp += 3;
|
rp[3] = DIG(val & 07);
|
||||||
*rp-- = DIG(val & 07);
|
|
||||||
val >>= 3;
|
val >>= 3;
|
||||||
*rp-- = DIG(val & 07);
|
rp[2] = DIG(val & 07);
|
||||||
val >>= 3;
|
val >>= 3;
|
||||||
*rp = DIG(val & 03);
|
rp[1] = DIG(val & 03);
|
||||||
rp += 3;
|
rp += 4;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
*rp = '\0';
|
*rp = '\0';
|
||||||
return result;
|
PG_RETURN_CSTRING(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -663,13 +664,12 @@ text_smaller(PG_FUNCTION_ARGS)
|
||||||
* get the number of bytes contained in an instance of type 'bytea'
|
* get the number of bytes contained in an instance of type 'bytea'
|
||||||
*-------------------------------------------------------------
|
*-------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
int32
|
Datum
|
||||||
byteaoctetlen(bytea *v)
|
byteaoctetlen(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
if (!PointerIsValid(v))
|
bytea *v = PG_GETARG_BYTEA_P(0);
|
||||||
return 0;
|
|
||||||
|
|
||||||
return VARSIZE(v) - VARHDRSZ;
|
PG_RETURN_INT32(VARSIZE(v) - VARHDRSZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-------------------------------------------------------------
|
/*-------------------------------------------------------------
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||||
* 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.149 2000/07/28 05:07:42 tgl Exp $
|
* $Id: pg_proc.h,v 1.150 2000/07/29 03:26:43 tgl 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
|
||||||
|
@ -101,9 +101,9 @@ DATA(insert OID = 1242 ( boolin PGUID 12 f t t t 1 f 16 "0" 100 0 0 100 b
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
DATA(insert OID = 1243 ( boolout PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 boolout - ));
|
DATA(insert OID = 1243 ( boolout PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 boolout - ));
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
DATA(insert OID = 1244 ( byteain PGUID 11 f t t t 1 f 17 "0" 100 0 0 100 byteain - ));
|
DATA(insert OID = 1244 ( byteain PGUID 12 f t t t 1 f 17 "0" 100 0 0 100 byteain - ));
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
DATA(insert OID = 31 ( byteaout PGUID 11 f t t t 1 f 23 "0" 100 0 0 100 byteaout - ));
|
DATA(insert OID = 31 ( byteaout PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 byteaout - ));
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
DATA(insert OID = 1245 ( charin PGUID 12 f t t t 1 f 18 "0" 100 0 0 100 charin - ));
|
DATA(insert OID = 1245 ( charin PGUID 12 f t t t 1 f 18 "0" 100 0 0 100 charin - ));
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
|
@ -786,9 +786,9 @@ DATA(insert OID = 406 ( text PGUID 12 f t t t 1 f 25 "19" 100 0 0 100 nam
|
||||||
DESCR("convert name to text");
|
DESCR("convert name to text");
|
||||||
DATA(insert OID = 407 ( name PGUID 12 f t t t 1 f 19 "25" 100 0 0 100 text_name - ));
|
DATA(insert OID = 407 ( name PGUID 12 f t t t 1 f 19 "25" 100 0 0 100 text_name - ));
|
||||||
DESCR("convert text to name");
|
DESCR("convert text to name");
|
||||||
DATA(insert OID = 408 ( bpchar PGUID 11 f t t t 1 f 1042 "19" 100 0 0 100 name_bpchar - ));
|
DATA(insert OID = 408 ( bpchar PGUID 12 f t t t 1 f 1042 "19" 100 0 0 100 name_bpchar - ));
|
||||||
DESCR("convert name to char()");
|
DESCR("convert name to char()");
|
||||||
DATA(insert OID = 409 ( name PGUID 11 f t t t 1 f 19 "1042" 100 0 0 100 bpchar_name - ));
|
DATA(insert OID = 409 ( name PGUID 12 f t t t 1 f 19 "1042" 100 0 0 100 bpchar_name - ));
|
||||||
DESCR("convert char() to name");
|
DESCR("convert char() to name");
|
||||||
|
|
||||||
DATA(insert OID = 438 ( hashcostestimate PGUID 12 f t f t 7 f 0 "0 0 0 0 0 0 0" 100 0 0 100 hashcostestimate - ));
|
DATA(insert OID = 438 ( hashcostestimate PGUID 12 f t f t 7 f 0 "0 0 0 0 0 0 0" 100 0 0 100 hashcostestimate - ));
|
||||||
|
@ -943,7 +943,7 @@ DESCR("equal");
|
||||||
DATA(insert OID = 717 ( int4eqoid PGUID 12 f t t t 2 f 16 "23 26" 100 0 0 100 int4eqoid - ));
|
DATA(insert OID = 717 ( int4eqoid PGUID 12 f t t t 2 f 16 "23 26" 100 0 0 100 int4eqoid - ));
|
||||||
DESCR("equal");
|
DESCR("equal");
|
||||||
|
|
||||||
DATA(insert OID = 720 ( octet_length PGUID 11 f t t t 1 f 23 "17" 100 0 0 100 byteaoctetlen - ));
|
DATA(insert OID = 720 ( octet_length PGUID 12 f t t t 1 f 23 "17" 100 0 0 100 byteaoctetlen - ));
|
||||||
DESCR("");
|
DESCR("");
|
||||||
DATA(insert OID = 721 ( get_byte PGUID 12 f t t t 2 f 23 "17 23" 100 0 0 100 byteaGetByte - ));
|
DATA(insert OID = 721 ( get_byte PGUID 12 f t t t 2 f 23 "17 23" 100 0 0 100 byteaGetByte - ));
|
||||||
DESCR("");
|
DESCR("");
|
||||||
|
@ -1293,33 +1293,33 @@ DATA(insert OID = 1046 ( varcharin PGUID 12 f t t t 3 f 1043 "0 26 23" 100
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
DATA(insert OID = 1047 ( varcharout PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 varcharout - ));
|
DATA(insert OID = 1047 ( varcharout PGUID 12 f t t t 1 f 23 "0" 100 0 0 100 varcharout - ));
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
DATA(insert OID = 1048 ( bpchareq PGUID 11 f t t t 2 f 16 "1042 1042" 100 0 0 100 bpchareq - ));
|
DATA(insert OID = 1048 ( bpchareq PGUID 12 f t t t 2 f 16 "1042 1042" 100 0 0 100 bpchareq - ));
|
||||||
DESCR("equal");
|
DESCR("equal");
|
||||||
DATA(insert OID = 1049 ( bpcharlt PGUID 11 f t t t 2 f 16 "1042 1042" 100 0 0 100 bpcharlt - ));
|
DATA(insert OID = 1049 ( bpcharlt PGUID 12 f t t t 2 f 16 "1042 1042" 100 0 0 100 bpcharlt - ));
|
||||||
DESCR("less-than");
|
DESCR("less-than");
|
||||||
DATA(insert OID = 1050 ( bpcharle PGUID 11 f t t t 2 f 16 "1042 1042" 100 0 0 100 bpcharle - ));
|
DATA(insert OID = 1050 ( bpcharle PGUID 12 f t t t 2 f 16 "1042 1042" 100 0 0 100 bpcharle - ));
|
||||||
DESCR("less-than-or-equal");
|
DESCR("less-than-or-equal");
|
||||||
DATA(insert OID = 1051 ( bpchargt PGUID 11 f t t t 2 f 16 "1042 1042" 100 0 0 100 bpchargt - ));
|
DATA(insert OID = 1051 ( bpchargt PGUID 12 f t t t 2 f 16 "1042 1042" 100 0 0 100 bpchargt - ));
|
||||||
DESCR("greater-than");
|
DESCR("greater-than");
|
||||||
DATA(insert OID = 1052 ( bpcharge PGUID 11 f t t t 2 f 16 "1042 1042" 100 0 0 100 bpcharge - ));
|
DATA(insert OID = 1052 ( bpcharge PGUID 12 f t t t 2 f 16 "1042 1042" 100 0 0 100 bpcharge - ));
|
||||||
DESCR("greater-than-or-equal");
|
DESCR("greater-than-or-equal");
|
||||||
DATA(insert OID = 1053 ( bpcharne PGUID 11 f t t t 2 f 16 "1042 1042" 100 0 0 100 bpcharne - ));
|
DATA(insert OID = 1053 ( bpcharne PGUID 12 f t t t 2 f 16 "1042 1042" 100 0 0 100 bpcharne - ));
|
||||||
DESCR("not equal");
|
DESCR("not equal");
|
||||||
DATA(insert OID = 1070 ( varchareq PGUID 11 f t t t 2 f 16 "1043 1043" 100 0 0 100 varchareq - ));
|
DATA(insert OID = 1070 ( varchareq PGUID 12 f t t t 2 f 16 "1043 1043" 100 0 0 100 varchareq - ));
|
||||||
DESCR("equal");
|
DESCR("equal");
|
||||||
DATA(insert OID = 1071 ( varcharlt PGUID 11 f t t t 2 f 16 "1043 1043" 100 0 0 100 varcharlt - ));
|
DATA(insert OID = 1071 ( varcharlt PGUID 12 f t t t 2 f 16 "1043 1043" 100 0 0 100 varcharlt - ));
|
||||||
DESCR("less-than");
|
DESCR("less-than");
|
||||||
DATA(insert OID = 1072 ( varcharle PGUID 11 f t t t 2 f 16 "1043 1043" 100 0 0 100 varcharle - ));
|
DATA(insert OID = 1072 ( varcharle PGUID 12 f t t t 2 f 16 "1043 1043" 100 0 0 100 varcharle - ));
|
||||||
DESCR("less-than-or-equal");
|
DESCR("less-than-or-equal");
|
||||||
DATA(insert OID = 1073 ( varchargt PGUID 11 f t t t 2 f 16 "1043 1043" 100 0 0 100 varchargt - ));
|
DATA(insert OID = 1073 ( varchargt PGUID 12 f t t t 2 f 16 "1043 1043" 100 0 0 100 varchargt - ));
|
||||||
DESCR("greater-than");
|
DESCR("greater-than");
|
||||||
DATA(insert OID = 1074 ( varcharge PGUID 11 f t t t 2 f 16 "1043 1043" 100 0 0 100 varcharge - ));
|
DATA(insert OID = 1074 ( varcharge PGUID 12 f t t t 2 f 16 "1043 1043" 100 0 0 100 varcharge - ));
|
||||||
DESCR("greater-than-or-equal");
|
DESCR("greater-than-or-equal");
|
||||||
DATA(insert OID = 1075 ( varcharne PGUID 11 f t t t 2 f 16 "1043 1043" 100 0 0 100 varcharne - ));
|
DATA(insert OID = 1075 ( varcharne PGUID 12 f t t t 2 f 16 "1043 1043" 100 0 0 100 varcharne - ));
|
||||||
DESCR("not equal");
|
DESCR("not equal");
|
||||||
DATA(insert OID = 1078 ( bpcharcmp PGUID 11 f t t t 2 f 23 "1042 1042" 100 0 0 100 bpcharcmp - ));
|
DATA(insert OID = 1078 ( bpcharcmp PGUID 12 f t t t 2 f 23 "1042 1042" 100 0 0 100 bpcharcmp - ));
|
||||||
DESCR("less-equal-greater");
|
DESCR("less-equal-greater");
|
||||||
DATA(insert OID = 1079 ( varcharcmp PGUID 11 f t t t 2 f 23 "1043 1043" 100 0 0 100 varcharcmp - ));
|
DATA(insert OID = 1079 ( varcharcmp PGUID 12 f t t t 2 f 23 "1043 1043" 100 0 0 100 varcharcmp - ));
|
||||||
DESCR("less-equal-greater");
|
DESCR("less-equal-greater");
|
||||||
DATA(insert OID = 1080 ( hashbpchar PGUID 12 f t t t 1 f 23 "1042" 100 0 0 100 hashbpchar - ));
|
DATA(insert OID = 1080 ( hashbpchar PGUID 12 f t t t 1 f 23 "1042" 100 0 0 100 hashbpchar - ));
|
||||||
DESCR("hash");
|
DESCR("hash");
|
||||||
|
@ -1591,9 +1591,9 @@ DESCR("convert timestamp to time");
|
||||||
|
|
||||||
DATA(insert OID = 1317 ( length PGUID 12 f t t t 1 f 23 "25" 100 0 1 0 textlen - ));
|
DATA(insert OID = 1317 ( length PGUID 12 f t t t 1 f 23 "25" 100 0 1 0 textlen - ));
|
||||||
DESCR("length");
|
DESCR("length");
|
||||||
DATA(insert OID = 1318 ( length PGUID 11 f t t t 1 f 23 "1042" 100 0 0 100 bpcharlen - ));
|
DATA(insert OID = 1318 ( length PGUID 12 f t t t 1 f 23 "1042" 100 0 0 100 bpcharlen - ));
|
||||||
DESCR("character length");
|
DESCR("character length");
|
||||||
DATA(insert OID = 1319 ( length PGUID 11 f t t t 1 f 23 "1043" 100 0 0 100 varcharlen - ));
|
DATA(insert OID = 1319 ( length PGUID 12 f t t t 1 f 23 "1043" 100 0 0 100 varcharlen - ));
|
||||||
DESCR("character length");
|
DESCR("character length");
|
||||||
|
|
||||||
DATA(insert OID = 1326 ( interval_div PGUID 12 f t f t 2 f 1186 "1186 701" 100 0 0 100 interval_div - ));
|
DATA(insert OID = 1326 ( interval_div PGUID 12 f t f t 2 f 1186 "1186 701" 100 0 0 100 interval_div - ));
|
||||||
|
@ -1661,16 +1661,16 @@ DATA(insert OID = 1370 ( interval PGUID 12 f t f t 1 f 1186 "1083" 100 0 0 1
|
||||||
DESCR("convert time to interval");
|
DESCR("convert time to interval");
|
||||||
DATA(insert OID = 1371 ( date PGUID 14 f t t t 1 f 1082 "1082" 100 0 0 100 "select $1" - ));
|
DATA(insert OID = 1371 ( date PGUID 14 f t t t 1 f 1082 "1082" 100 0 0 100 "select $1" - ));
|
||||||
DESCR("convert (noop)");
|
DESCR("convert (noop)");
|
||||||
DATA(insert OID = 1372 ( char_length PGUID 11 f t t t 1 f 23 "1042" 100 0 0 100 bpcharlen - ));
|
DATA(insert OID = 1372 ( char_length PGUID 12 f t t t 1 f 23 "1042" 100 0 0 100 bpcharlen - ));
|
||||||
DESCR("character length");
|
DESCR("character length");
|
||||||
DATA(insert OID = 1373 ( char_length PGUID 11 f t t t 1 f 23 "1043" 100 0 0 100 varcharlen - ));
|
DATA(insert OID = 1373 ( char_length PGUID 12 f t t t 1 f 23 "1043" 100 0 0 100 varcharlen - ));
|
||||||
DESCR("character length");
|
DESCR("character length");
|
||||||
|
|
||||||
DATA(insert OID = 1374 ( octet_length PGUID 12 f t t t 1 f 23 "25" 100 0 0 100 textoctetlen - ));
|
DATA(insert OID = 1374 ( octet_length PGUID 12 f t t t 1 f 23 "25" 100 0 0 100 textoctetlen - ));
|
||||||
DESCR("octet length");
|
DESCR("octet length");
|
||||||
DATA(insert OID = 1375 ( octet_length PGUID 11 f t t t 1 f 23 "1042" 100 0 0 100 bpcharoctetlen - ));
|
DATA(insert OID = 1375 ( octet_length PGUID 12 f t t t 1 f 23 "1042" 100 0 0 100 bpcharoctetlen - ));
|
||||||
DESCR("octet length");
|
DESCR("octet length");
|
||||||
DATA(insert OID = 1376 ( octet_length PGUID 11 f t t t 1 f 23 "1043" 100 0 0 100 varcharoctetlen - ));
|
DATA(insert OID = 1376 ( octet_length PGUID 12 f t t t 1 f 23 "1043" 100 0 0 100 varcharoctetlen - ));
|
||||||
DESCR("octet length");
|
DESCR("octet length");
|
||||||
|
|
||||||
DATA(insert OID = 1377 ( time_larger PGUID 12 f t t t 2 f 1083 "1083 1083" 100 0 0 100 time_larger - ));
|
DATA(insert OID = 1377 ( time_larger PGUID 12 f t t t 2 f 1083 "1083 1083" 100 0 0 100 time_larger - ));
|
||||||
|
@ -2313,11 +2313,11 @@ DATA(insert OID = 1702 ( numeric_out PGUID 12 f t t t 1 f 23 "0" 100 0 0 100
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
DATA(insert OID = 1703 ( numeric PGUID 12 f t t t 2 f 1700 "1700 23" 100 0 0 100 numeric - ));
|
DATA(insert OID = 1703 ( numeric PGUID 12 f t t t 2 f 1700 "1700 23" 100 0 0 100 numeric - ));
|
||||||
DESCR("adjust numeric to typmod precision/scale");
|
DESCR("adjust numeric to typmod precision/scale");
|
||||||
DATA(insert OID = 1704 ( numeric_abs PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_abs - ));
|
DATA(insert OID = 1704 ( numeric_abs PGUID 12 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_abs - ));
|
||||||
DESCR("absolute value");
|
DESCR("absolute value");
|
||||||
DATA(insert OID = 1705 ( abs PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_abs - ));
|
DATA(insert OID = 1705 ( abs PGUID 12 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_abs - ));
|
||||||
DESCR("absolute value");
|
DESCR("absolute value");
|
||||||
DATA(insert OID = 1706 ( sign PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_sign - ));
|
DATA(insert OID = 1706 ( sign PGUID 12 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_sign - ));
|
||||||
DESCR("sign of value");
|
DESCR("sign of value");
|
||||||
DATA(insert OID = 1707 ( round PGUID 12 f t t t 2 f 1700 "1700 23" 100 0 0 100 numeric_round - ));
|
DATA(insert OID = 1707 ( round PGUID 12 f t t t 2 f 1700 "1700 23" 100 0 0 100 numeric_round - ));
|
||||||
DESCR("value rounded to 'scale'");
|
DESCR("value rounded to 'scale'");
|
||||||
|
@ -2327,79 +2327,79 @@ DATA(insert OID = 1709 ( trunc PGUID 12 f t t t 2 f 1700 "1700 23" 100 0 0 1
|
||||||
DESCR("value truncated to 'scale'");
|
DESCR("value truncated to 'scale'");
|
||||||
DATA(insert OID = 1710 ( trunc PGUID 14 f t t t 1 f 1700 "1700" 100 0 0 100 "select trunc($1,0)" - ));
|
DATA(insert OID = 1710 ( trunc PGUID 14 f t t t 1 f 1700 "1700" 100 0 0 100 "select trunc($1,0)" - ));
|
||||||
DESCR("value truncated to 'scale' of zero");
|
DESCR("value truncated to 'scale' of zero");
|
||||||
DATA(insert OID = 1711 ( ceil PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_ceil - ));
|
DATA(insert OID = 1711 ( ceil PGUID 12 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_ceil - ));
|
||||||
DESCR("smallest integer >= value");
|
DESCR("smallest integer >= value");
|
||||||
DATA(insert OID = 1712 ( floor PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_floor - ));
|
DATA(insert OID = 1712 ( floor PGUID 12 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_floor - ));
|
||||||
DESCR("largest integer <= value");
|
DESCR("largest integer <= value");
|
||||||
DATA(insert OID = 1718 ( numeric_eq PGUID 11 f t t t 2 f 16 "1700 1700" 100 0 0 100 numeric_eq - ));
|
DATA(insert OID = 1718 ( numeric_eq PGUID 12 f t t t 2 f 16 "1700 1700" 100 0 0 100 numeric_eq - ));
|
||||||
DESCR("equal");
|
DESCR("equal");
|
||||||
DATA(insert OID = 1719 ( numeric_ne PGUID 11 f t t t 2 f 16 "1700 1700" 100 0 0 100 numeric_ne - ));
|
DATA(insert OID = 1719 ( numeric_ne PGUID 12 f t t t 2 f 16 "1700 1700" 100 0 0 100 numeric_ne - ));
|
||||||
DESCR("not equal");
|
DESCR("not equal");
|
||||||
DATA(insert OID = 1720 ( numeric_gt PGUID 11 f t t t 2 f 16 "1700 1700" 100 0 0 100 numeric_gt - ));
|
DATA(insert OID = 1720 ( numeric_gt PGUID 12 f t t t 2 f 16 "1700 1700" 100 0 0 100 numeric_gt - ));
|
||||||
DESCR("greater-than");
|
DESCR("greater-than");
|
||||||
DATA(insert OID = 1721 ( numeric_ge PGUID 11 f t t t 2 f 16 "1700 1700" 100 0 0 100 numeric_ge - ));
|
DATA(insert OID = 1721 ( numeric_ge PGUID 12 f t t t 2 f 16 "1700 1700" 100 0 0 100 numeric_ge - ));
|
||||||
DESCR("greater-than-or-equal");
|
DESCR("greater-than-or-equal");
|
||||||
DATA(insert OID = 1722 ( numeric_lt PGUID 11 f t t t 2 f 16 "1700 1700" 100 0 0 100 numeric_lt - ));
|
DATA(insert OID = 1722 ( numeric_lt PGUID 12 f t t t 2 f 16 "1700 1700" 100 0 0 100 numeric_lt - ));
|
||||||
DESCR("lower-than");
|
DESCR("lower-than");
|
||||||
DATA(insert OID = 1723 ( numeric_le PGUID 11 f t t t 2 f 16 "1700 1700" 100 0 0 100 numeric_le - ));
|
DATA(insert OID = 1723 ( numeric_le PGUID 12 f t t t 2 f 16 "1700 1700" 100 0 0 100 numeric_le - ));
|
||||||
DESCR("lower-than-or-equal");
|
DESCR("lower-than-or-equal");
|
||||||
DATA(insert OID = 1724 ( numeric_add PGUID 11 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_add - ));
|
DATA(insert OID = 1724 ( numeric_add PGUID 12 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_add - ));
|
||||||
DESCR("addition");
|
DESCR("addition");
|
||||||
DATA(insert OID = 1725 ( numeric_sub PGUID 11 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_sub - ));
|
DATA(insert OID = 1725 ( numeric_sub PGUID 12 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_sub - ));
|
||||||
DESCR("subtract");
|
DESCR("subtract");
|
||||||
DATA(insert OID = 1726 ( numeric_mul PGUID 11 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_mul - ));
|
DATA(insert OID = 1726 ( numeric_mul PGUID 12 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_mul - ));
|
||||||
DESCR("multiply");
|
DESCR("multiply");
|
||||||
DATA(insert OID = 1727 ( numeric_div PGUID 11 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_div - ));
|
DATA(insert OID = 1727 ( numeric_div PGUID 12 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_div - ));
|
||||||
DESCR("divide");
|
DESCR("divide");
|
||||||
DATA(insert OID = 1728 ( mod PGUID 11 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_mod - ));
|
DATA(insert OID = 1728 ( mod PGUID 12 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_mod - ));
|
||||||
DESCR("modulus");
|
DESCR("modulus");
|
||||||
DATA(insert OID = 1729 ( numeric_mod PGUID 11 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_mod - ));
|
DATA(insert OID = 1729 ( numeric_mod PGUID 12 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_mod - ));
|
||||||
DESCR("modulus");
|
DESCR("modulus");
|
||||||
DATA(insert OID = 1730 ( sqrt PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_sqrt - ));
|
DATA(insert OID = 1730 ( sqrt PGUID 12 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_sqrt - ));
|
||||||
DESCR("square root");
|
DESCR("square root");
|
||||||
DATA(insert OID = 1731 ( numeric_sqrt PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_sqrt - ));
|
DATA(insert OID = 1731 ( numeric_sqrt PGUID 12 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_sqrt - ));
|
||||||
DESCR("square root");
|
DESCR("square root");
|
||||||
DATA(insert OID = 1732 ( exp PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_exp - ));
|
DATA(insert OID = 1732 ( exp PGUID 12 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_exp - ));
|
||||||
DESCR("e raised to the power of n");
|
DESCR("e raised to the power of n");
|
||||||
DATA(insert OID = 1733 ( numeric_exp PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_exp - ));
|
DATA(insert OID = 1733 ( numeric_exp PGUID 12 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_exp - ));
|
||||||
DESCR("e raised to the power of n");
|
DESCR("e raised to the power of n");
|
||||||
DATA(insert OID = 1734 ( ln PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_ln - ));
|
DATA(insert OID = 1734 ( ln PGUID 12 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_ln - ));
|
||||||
DESCR("natural logarithm of n");
|
DESCR("natural logarithm of n");
|
||||||
DATA(insert OID = 1735 ( numeric_ln PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_ln - ));
|
DATA(insert OID = 1735 ( numeric_ln PGUID 12 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_ln - ));
|
||||||
DESCR("natural logarithm of n");
|
DESCR("natural logarithm of n");
|
||||||
DATA(insert OID = 1736 ( log PGUID 11 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_log - ));
|
DATA(insert OID = 1736 ( log PGUID 12 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_log - ));
|
||||||
DESCR("logarithm base m of n");
|
DESCR("logarithm base m of n");
|
||||||
DATA(insert OID = 1737 ( numeric_log PGUID 11 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_log - ));
|
DATA(insert OID = 1737 ( numeric_log PGUID 12 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_log - ));
|
||||||
DESCR("logarithm base m of n");
|
DESCR("logarithm base m of n");
|
||||||
DATA(insert OID = 1738 ( pow PGUID 11 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_power - ));
|
DATA(insert OID = 1738 ( pow PGUID 12 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_power - ));
|
||||||
DESCR("m raised to the power of n");
|
DESCR("m raised to the power of n");
|
||||||
DATA(insert OID = 1739 ( numeric_power PGUID 11 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_power - ));
|
DATA(insert OID = 1739 ( numeric_power PGUID 12 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_power - ));
|
||||||
DESCR("m raised to the power of n");
|
DESCR("m raised to the power of n");
|
||||||
DATA(insert OID = 1740 ( numeric PGUID 12 f t t t 1 f 1700 "23" 100 0 0 100 int4_numeric - ));
|
DATA(insert OID = 1740 ( numeric PGUID 12 f t t t 1 f 1700 "23" 100 0 0 100 int4_numeric - ));
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
DATA(insert OID = 1741 ( log PGUID 14 f t t t 1 f 1700 "1700" 100 0 0 100 "select log(10, $1)" - ));
|
DATA(insert OID = 1741 ( log PGUID 14 f t t t 1 f 1700 "1700" 100 0 0 100 "select log(10, $1)" - ));
|
||||||
DESCR("logarithm base 10 of n");
|
DESCR("logarithm base 10 of n");
|
||||||
DATA(insert OID = 1742 ( numeric PGUID 11 f t t t 1 f 1700 "700" 100 0 0 100 float4_numeric - ));
|
DATA(insert OID = 1742 ( numeric PGUID 12 f t t t 1 f 1700 "700" 100 0 0 100 float4_numeric - ));
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
DATA(insert OID = 1743 ( numeric PGUID 11 f t t t 1 f 1700 "701" 100 0 0 100 float8_numeric - ));
|
DATA(insert OID = 1743 ( numeric PGUID 12 f t t t 1 f 1700 "701" 100 0 0 100 float8_numeric - ));
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
DATA(insert OID = 1744 ( int4 PGUID 11 f t t t 1 f 23 "1700" 100 0 0 100 numeric_int4 - ));
|
DATA(insert OID = 1744 ( int4 PGUID 12 f t t t 1 f 23 "1700" 100 0 0 100 numeric_int4 - ));
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
DATA(insert OID = 1745 ( float4 PGUID 11 f t t t 1 f 700 "1700" 100 0 0 100 numeric_float4 - ));
|
DATA(insert OID = 1745 ( float4 PGUID 12 f t t t 1 f 700 "1700" 100 0 0 100 numeric_float4 - ));
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
DATA(insert OID = 1746 ( float8 PGUID 11 f t t t 1 f 701 "1700" 100 0 0 100 numeric_float8 - ));
|
DATA(insert OID = 1746 ( float8 PGUID 12 f t t t 1 f 701 "1700" 100 0 0 100 numeric_float8 - ));
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
DATA(insert OID = 1764 ( numeric_inc PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_inc - ));
|
DATA(insert OID = 1764 ( numeric_inc PGUID 12 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_inc - ));
|
||||||
DESCR("increment by one");
|
DESCR("increment by one");
|
||||||
DATA(insert OID = 1766 ( numeric_smaller PGUID 11 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_smaller - ));
|
DATA(insert OID = 1766 ( numeric_smaller PGUID 12 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_smaller - ));
|
||||||
DESCR("smaller of two numbers");
|
DESCR("smaller of two numbers");
|
||||||
DATA(insert OID = 1767 ( numeric_larger PGUID 11 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_larger - ));
|
DATA(insert OID = 1767 ( numeric_larger PGUID 12 f t t t 2 f 1700 "1700 1700" 100 0 0 100 numeric_larger - ));
|
||||||
DESCR("larger of two numbers");
|
DESCR("larger of two numbers");
|
||||||
DATA(insert OID = 1769 ( numeric_cmp PGUID 11 f t t t 2 f 23 "1700 1700" 100 0 0 100 numeric_cmp - ));
|
DATA(insert OID = 1769 ( numeric_cmp PGUID 12 f t t t 2 f 23 "1700 1700" 100 0 0 100 numeric_cmp - ));
|
||||||
DESCR("compare two numbers");
|
DESCR("compare two numbers");
|
||||||
DATA(insert OID = 1771 ( numeric_uminus PGUID 11 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_uminus - ));
|
DATA(insert OID = 1771 ( numeric_uminus PGUID 12 f t t t 1 f 1700 "1700" 100 0 0 100 numeric_uminus - ));
|
||||||
DESCR("negate");
|
DESCR("negate");
|
||||||
DATA(insert OID = 1779 ( int8 PGUID 11 f t t t 1 f 20 "1700" 100 0 0 100 numeric_int8 - ));
|
DATA(insert OID = 1779 ( int8 PGUID 12 f t t t 1 f 20 "1700" 100 0 0 100 numeric_int8 - ));
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
DATA(insert OID = 1781 ( numeric PGUID 12 f t t t 1 f 1700 "20" 100 0 0 100 int8_numeric - ));
|
DATA(insert OID = 1781 ( numeric PGUID 12 f t t t 1 f 1700 "20" 100 0 0 100 int8_numeric - ));
|
||||||
DESCR("(internal)");
|
DESCR("(internal)");
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: pg_type.h,v 1.93 2000/07/22 03:34:28 tgl Exp $
|
* $Id: pg_type.h,v 1.94 2000/07/29 03:26:43 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* the genbki.sh script reads this file and generates .bki
|
* the genbki.sh script reads this file and generates .bki
|
||||||
|
@ -174,7 +174,7 @@ DATA(insert OID = 16 ( bool PGUID 1 1 t b t \054 0 0 boolin boolout bool
|
||||||
DESCR("boolean, 'true'/'false'");
|
DESCR("boolean, 'true'/'false'");
|
||||||
#define BOOLOID 16
|
#define BOOLOID 16
|
||||||
|
|
||||||
DATA(insert OID = 17 ( bytea PGUID -1 -1 f b t \054 0 0 byteain byteaout byteain byteaout i p _null_ ));
|
DATA(insert OID = 17 ( bytea PGUID -1 -1 f b t \054 0 0 byteain byteaout byteain byteaout i x _null_ ));
|
||||||
DESCR("variable-length string, binary values escaped");
|
DESCR("variable-length string, binary values escaped");
|
||||||
#define BYTEAOID 17
|
#define BYTEAOID 17
|
||||||
|
|
||||||
|
@ -368,10 +368,10 @@ DATA(insert OID = 1034 ( _aclitem PGUID -1 -1 f b t \054 0 1033 array_in array
|
||||||
DATA(insert OID = 1040 ( _macaddr PGUID -1 -1 f b t \054 0 829 array_in array_out array_in array_out i x _null_ ));
|
DATA(insert OID = 1040 ( _macaddr PGUID -1 -1 f b t \054 0 829 array_in array_out array_in array_out i x _null_ ));
|
||||||
DATA(insert OID = 1041 ( _inet PGUID -1 -1 f b t \054 0 869 array_in array_out array_in array_out i x _null_ ));
|
DATA(insert OID = 1041 ( _inet PGUID -1 -1 f b t \054 0 869 array_in array_out array_in array_out i x _null_ ));
|
||||||
DATA(insert OID = 651 ( _cidr PGUID -1 -1 f b t \054 0 650 array_in array_out array_in array_out i x _null_ ));
|
DATA(insert OID = 651 ( _cidr PGUID -1 -1 f b t \054 0 650 array_in array_out array_in array_out i x _null_ ));
|
||||||
DATA(insert OID = 1042 ( bpchar PGUID -1 -1 f b t \054 0 0 bpcharin bpcharout bpcharin bpcharout i p _null_ ));
|
DATA(insert OID = 1042 ( bpchar PGUID -1 -1 f b t \054 0 0 bpcharin bpcharout bpcharin bpcharout i x _null_ ));
|
||||||
DESCR("char(length), blank-padded string, fixed storage length");
|
DESCR("char(length), blank-padded string, fixed storage length");
|
||||||
#define BPCHAROID 1042
|
#define BPCHAROID 1042
|
||||||
DATA(insert OID = 1043 ( varchar PGUID -1 -1 f b t \054 0 0 varcharin varcharout varcharin varcharout i p _null_ ));
|
DATA(insert OID = 1043 ( varchar PGUID -1 -1 f b t \054 0 0 varcharin varcharout varcharin varcharout i x _null_ ));
|
||||||
DESCR("varchar(length), non-blank-padded string, variable storage length");
|
DESCR("varchar(length), non-blank-padded string, variable storage length");
|
||||||
#define VARCHAROID 1043
|
#define VARCHAROID 1043
|
||||||
|
|
||||||
|
@ -417,7 +417,7 @@ DESCR("variable-length string, stored compressed");
|
||||||
#define LZTEXTOID 1625
|
#define LZTEXTOID 1625
|
||||||
|
|
||||||
/* OIDS 1700 - 1799 */
|
/* OIDS 1700 - 1799 */
|
||||||
DATA(insert OID = 1700 ( numeric PGUID -1 -1 f b t \054 0 0 numeric_in numeric_out numeric_in numeric_out i p _null_ ));
|
DATA(insert OID = 1700 ( numeric PGUID -1 -1 f b t \054 0 0 numeric_in numeric_out numeric_in numeric_out i m _null_ ));
|
||||||
DESCR("numeric(precision, decimal), arbitrary precision number");
|
DESCR("numeric(precision, decimal), arbitrary precision number");
|
||||||
#define NUMERICOID 1700
|
#define NUMERICOID 1700
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: fmgr.h,v 1.8 2000/07/12 02:37:25 tgl Exp $
|
* $Id: fmgr.h,v 1.9 2000/07/29 03:26:47 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -185,6 +185,7 @@ extern struct varlena * pg_detoast_datum_copy(struct varlena * datum);
|
||||||
|
|
||||||
/* Macros for returning results of standard types */
|
/* Macros for returning results of standard types */
|
||||||
|
|
||||||
|
#define PG_RETURN_DATUM(x) return (x)
|
||||||
#define PG_RETURN_INT32(x) return Int32GetDatum(x)
|
#define PG_RETURN_INT32(x) return Int32GetDatum(x)
|
||||||
#define PG_RETURN_UINT32(x) return UInt32GetDatum(x)
|
#define PG_RETURN_UINT32(x) return UInt32GetDatum(x)
|
||||||
#define PG_RETURN_INT16(x) return Int16GetDatum(x)
|
#define PG_RETURN_INT16(x) return Int16GetDatum(x)
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: builtins.h,v 1.124 2000/07/17 03:05:32 tgl Exp $
|
* $Id: builtins.h,v 1.125 2000/07/29 03:26:51 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
@ -400,32 +400,32 @@ extern Datum bpchar(PG_FUNCTION_ARGS);
|
||||||
extern Datum _bpchar(PG_FUNCTION_ARGS);
|
extern Datum _bpchar(PG_FUNCTION_ARGS);
|
||||||
extern Datum char_bpchar(PG_FUNCTION_ARGS);
|
extern Datum char_bpchar(PG_FUNCTION_ARGS);
|
||||||
extern Datum bpchar_char(PG_FUNCTION_ARGS);
|
extern Datum bpchar_char(PG_FUNCTION_ARGS);
|
||||||
extern char *name_bpchar(NameData *s);
|
extern Datum name_bpchar(PG_FUNCTION_ARGS);
|
||||||
extern NameData *bpchar_name(char *s);
|
extern Datum bpchar_name(PG_FUNCTION_ARGS);
|
||||||
extern bool bpchareq(char *arg1, char *arg2);
|
extern Datum bpchareq(PG_FUNCTION_ARGS);
|
||||||
extern bool bpcharne(char *arg1, char *arg2);
|
extern Datum bpcharne(PG_FUNCTION_ARGS);
|
||||||
extern bool bpcharlt(char *arg1, char *arg2);
|
extern Datum bpcharlt(PG_FUNCTION_ARGS);
|
||||||
extern bool bpcharle(char *arg1, char *arg2);
|
extern Datum bpcharle(PG_FUNCTION_ARGS);
|
||||||
extern bool bpchargt(char *arg1, char *arg2);
|
extern Datum bpchargt(PG_FUNCTION_ARGS);
|
||||||
extern bool bpcharge(char *arg1, char *arg2);
|
extern Datum bpcharge(PG_FUNCTION_ARGS);
|
||||||
extern int32 bpcharcmp(char *arg1, char *arg2);
|
extern Datum bpcharcmp(PG_FUNCTION_ARGS);
|
||||||
extern int32 bpcharlen(char *arg);
|
extern Datum bpcharlen(PG_FUNCTION_ARGS);
|
||||||
extern int32 bpcharoctetlen(char *arg);
|
extern Datum bpcharoctetlen(PG_FUNCTION_ARGS);
|
||||||
extern Datum hashbpchar(PG_FUNCTION_ARGS);
|
extern Datum hashbpchar(PG_FUNCTION_ARGS);
|
||||||
|
|
||||||
extern Datum varcharin(PG_FUNCTION_ARGS);
|
extern Datum varcharin(PG_FUNCTION_ARGS);
|
||||||
extern Datum varcharout(PG_FUNCTION_ARGS);
|
extern Datum varcharout(PG_FUNCTION_ARGS);
|
||||||
extern Datum varchar(PG_FUNCTION_ARGS);
|
extern Datum varchar(PG_FUNCTION_ARGS);
|
||||||
extern Datum _varchar(PG_FUNCTION_ARGS);
|
extern Datum _varchar(PG_FUNCTION_ARGS);
|
||||||
extern bool varchareq(char *arg1, char *arg2);
|
extern Datum varchareq(PG_FUNCTION_ARGS);
|
||||||
extern bool varcharne(char *arg1, char *arg2);
|
extern Datum varcharne(PG_FUNCTION_ARGS);
|
||||||
extern bool varcharlt(char *arg1, char *arg2);
|
extern Datum varcharlt(PG_FUNCTION_ARGS);
|
||||||
extern bool varcharle(char *arg1, char *arg2);
|
extern Datum varcharle(PG_FUNCTION_ARGS);
|
||||||
extern bool varchargt(char *arg1, char *arg2);
|
extern Datum varchargt(PG_FUNCTION_ARGS);
|
||||||
extern bool varcharge(char *arg1, char *arg2);
|
extern Datum varcharge(PG_FUNCTION_ARGS);
|
||||||
extern int32 varcharcmp(char *arg1, char *arg2);
|
extern Datum varcharcmp(PG_FUNCTION_ARGS);
|
||||||
extern int32 varcharlen(char *arg);
|
extern Datum varcharlen(PG_FUNCTION_ARGS);
|
||||||
extern int32 varcharoctetlen(char *arg);
|
extern Datum varcharoctetlen(PG_FUNCTION_ARGS);
|
||||||
|
|
||||||
/* varlena.c */
|
/* varlena.c */
|
||||||
extern Datum textin(PG_FUNCTION_ARGS);
|
extern Datum textin(PG_FUNCTION_ARGS);
|
||||||
|
@ -447,9 +447,9 @@ extern Datum name_text(PG_FUNCTION_ARGS);
|
||||||
extern Datum text_name(PG_FUNCTION_ARGS);
|
extern Datum text_name(PG_FUNCTION_ARGS);
|
||||||
extern int varstr_cmp(char *arg1, int len1, char *arg2, int len2);
|
extern int varstr_cmp(char *arg1, int len1, char *arg2, int len2);
|
||||||
|
|
||||||
extern bytea *byteain(char *inputText);
|
extern Datum byteain(PG_FUNCTION_ARGS);
|
||||||
extern char *byteaout(bytea *vlena);
|
extern Datum byteaout(PG_FUNCTION_ARGS);
|
||||||
extern int32 byteaoctetlen(bytea *v);
|
extern Datum byteaoctetlen(PG_FUNCTION_ARGS);
|
||||||
extern Datum byteaGetByte(PG_FUNCTION_ARGS);
|
extern Datum byteaGetByte(PG_FUNCTION_ARGS);
|
||||||
extern Datum byteaGetBit(PG_FUNCTION_ARGS);
|
extern Datum byteaGetBit(PG_FUNCTION_ARGS);
|
||||||
extern Datum byteaSetByte(PG_FUNCTION_ARGS);
|
extern Datum byteaSetByte(PG_FUNCTION_ARGS);
|
||||||
|
@ -527,43 +527,43 @@ extern Datum macaddr_manuf(PG_FUNCTION_ARGS);
|
||||||
extern Datum numeric_in(PG_FUNCTION_ARGS);
|
extern Datum numeric_in(PG_FUNCTION_ARGS);
|
||||||
extern Datum numeric_out(PG_FUNCTION_ARGS);
|
extern Datum numeric_out(PG_FUNCTION_ARGS);
|
||||||
extern Datum numeric(PG_FUNCTION_ARGS);
|
extern Datum numeric(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_abs(Numeric num);
|
extern Datum numeric_abs(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_uminus(Numeric num);
|
extern Datum numeric_uminus(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_sign(Numeric num);
|
extern Datum numeric_sign(PG_FUNCTION_ARGS);
|
||||||
extern Datum numeric_round(PG_FUNCTION_ARGS);
|
extern Datum numeric_round(PG_FUNCTION_ARGS);
|
||||||
extern Datum numeric_trunc(PG_FUNCTION_ARGS);
|
extern Datum numeric_trunc(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_ceil(Numeric num);
|
extern Datum numeric_ceil(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_floor(Numeric num);
|
extern Datum numeric_floor(PG_FUNCTION_ARGS);
|
||||||
extern int32 numeric_cmp(Numeric num1, Numeric num2);
|
extern Datum numeric_cmp(PG_FUNCTION_ARGS);
|
||||||
extern bool numeric_eq(Numeric num1, Numeric num2);
|
extern Datum numeric_eq(PG_FUNCTION_ARGS);
|
||||||
extern bool numeric_ne(Numeric num1, Numeric num2);
|
extern Datum numeric_ne(PG_FUNCTION_ARGS);
|
||||||
extern bool numeric_gt(Numeric num1, Numeric num2);
|
extern Datum numeric_gt(PG_FUNCTION_ARGS);
|
||||||
extern bool numeric_ge(Numeric num1, Numeric num2);
|
extern Datum numeric_ge(PG_FUNCTION_ARGS);
|
||||||
extern bool numeric_lt(Numeric num1, Numeric num2);
|
extern Datum numeric_lt(PG_FUNCTION_ARGS);
|
||||||
extern bool numeric_le(Numeric num1, Numeric num2);
|
extern Datum numeric_le(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_add(Numeric num1, Numeric num2);
|
extern Datum numeric_add(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_sub(Numeric num1, Numeric num2);
|
extern Datum numeric_sub(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_mul(Numeric num1, Numeric num2);
|
extern Datum numeric_mul(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_div(Numeric num1, Numeric num2);
|
extern Datum numeric_div(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_mod(Numeric num1, Numeric num2);
|
extern Datum numeric_mod(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_inc(Numeric num);
|
extern Datum numeric_inc(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_smaller(Numeric num1, Numeric num2);
|
extern Datum numeric_smaller(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_larger(Numeric num1, Numeric num2);
|
extern Datum numeric_larger(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_sqrt(Numeric num);
|
extern Datum numeric_sqrt(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_exp(Numeric num);
|
extern Datum numeric_exp(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_ln(Numeric num);
|
extern Datum numeric_ln(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_log(Numeric num1, Numeric num2);
|
extern Datum numeric_log(PG_FUNCTION_ARGS);
|
||||||
extern Numeric numeric_power(Numeric num1, Numeric num2);
|
extern Datum numeric_power(PG_FUNCTION_ARGS);
|
||||||
extern Datum int4_numeric(PG_FUNCTION_ARGS);
|
extern Datum int4_numeric(PG_FUNCTION_ARGS);
|
||||||
extern int32 numeric_int4(Numeric num);
|
extern Datum numeric_int4(PG_FUNCTION_ARGS);
|
||||||
extern Datum int8_numeric(PG_FUNCTION_ARGS);
|
extern Datum int8_numeric(PG_FUNCTION_ARGS);
|
||||||
extern int64 *numeric_int8(Numeric num);
|
extern Datum numeric_int8(PG_FUNCTION_ARGS);
|
||||||
extern Datum int2_numeric(PG_FUNCTION_ARGS);
|
extern Datum int2_numeric(PG_FUNCTION_ARGS);
|
||||||
extern Datum numeric_int2(PG_FUNCTION_ARGS);
|
extern Datum numeric_int2(PG_FUNCTION_ARGS);
|
||||||
extern Numeric float8_numeric(float64 val);
|
extern Datum float8_numeric(PG_FUNCTION_ARGS);
|
||||||
extern float64 numeric_float8(Numeric num);
|
extern Datum numeric_float8(PG_FUNCTION_ARGS);
|
||||||
extern Numeric float4_numeric(float32 val);
|
extern Datum float4_numeric(PG_FUNCTION_ARGS);
|
||||||
extern float32 numeric_float4(Numeric num);
|
extern Datum numeric_float4(PG_FUNCTION_ARGS);
|
||||||
extern Datum numeric_accum(PG_FUNCTION_ARGS);
|
extern Datum numeric_accum(PG_FUNCTION_ARGS);
|
||||||
extern Datum int2_accum(PG_FUNCTION_ARGS);
|
extern Datum int2_accum(PG_FUNCTION_ARGS);
|
||||||
extern Datum int4_accum(PG_FUNCTION_ARGS);
|
extern Datum int4_accum(PG_FUNCTION_ARGS);
|
||||||
|
|
Loading…
Reference in New Issue