diff options
Diffstat (limited to 'src/backend/utils/adt/int.c')
-rw-r--r-- | src/backend/utils/adt/int.c | 66 |
1 files changed, 1 insertions, 65 deletions
diff --git a/src/backend/utils/adt/int.c b/src/backend/utils/adt/int.c index d6d59022077..405b16ecef8 100644 --- a/src/backend/utils/adt/int.c +++ b/src/backend/utils/adt/int.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/int.c,v 1.79 2007/02/27 23:48:08 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/int.c,v 1.80 2007/06/05 21:31:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -18,8 +18,6 @@ * int2in, int2out, int2recv, int2send * int4in, int4out, int4recv, int4send * int2vectorin, int2vectorout, int2vectorrecv, int2vectorsend - * Conversion routines: - * itoi, int2_text, int4_text * Boolean operators: * inteq, intne, intlt, intle, intgt, intge * Arithmetic operators: @@ -343,68 +341,6 @@ i4toi2(PG_FUNCTION_ARGS) PG_RETURN_INT16((int16) arg1); } -Datum -int2_text(PG_FUNCTION_ARGS) -{ - int16 arg1 = PG_GETARG_INT16(0); - text *result = (text *) palloc(7 + VARHDRSZ); /* sign,5 digits, '\0' */ - - pg_itoa(arg1, VARDATA(result)); - SET_VARSIZE(result, strlen(VARDATA(result)) + VARHDRSZ); - PG_RETURN_TEXT_P(result); -} - -Datum -text_int2(PG_FUNCTION_ARGS) -{ - text *string = PG_GETARG_TEXT_P(0); - Datum result; - int len; - char *str; - - len = VARSIZE(string) - VARHDRSZ; - - str = palloc(len + 1); - memcpy(str, VARDATA(string), len); - *(str + len) = '\0'; - - result = DirectFunctionCall1(int2in, CStringGetDatum(str)); - pfree(str); - - return result; -} - -Datum -int4_text(PG_FUNCTION_ARGS) -{ - int32 arg1 = PG_GETARG_INT32(0); - text *result = (text *) palloc(12 + VARHDRSZ); /* sign,10 digits,'\0' */ - - pg_ltoa(arg1, VARDATA(result)); - SET_VARSIZE(result, strlen(VARDATA(result)) + VARHDRSZ); - PG_RETURN_TEXT_P(result); -} - -Datum -text_int4(PG_FUNCTION_ARGS) -{ - text *string = PG_GETARG_TEXT_P(0); - Datum result; - int len; - char *str; - - len = VARSIZE(string) - VARHDRSZ; - - str = palloc(len + 1); - memcpy(str, VARDATA(string), len); - *(str + len) = '\0'; - - result = DirectFunctionCall1(int4in, CStringGetDatum(str)); - pfree(str); - - return result; -} - /* Cast int4 -> bool */ Datum int4_bool(PG_FUNCTION_ARGS) |