diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index aa56317c7f..141fc1bc94 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.164 2008/03/25 22:42:44 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.165 2008/04/12 23:21:04 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -754,7 +754,8 @@ text_substring(Datum str, int32 start, int32 length, bool length_not_specified) * If we're working with an untoasted source, no need to do an extra * copying step. */ - if (VARATT_IS_COMPRESSED(str) || VARATT_IS_EXTERNAL(str)) + if (VARATT_IS_COMPRESSED(DatumGetPointer(str)) || + VARATT_IS_EXTERNAL(DatumGetPointer(str))) slice = DatumGetTextPSlice(str, slice_start, slice_size); else slice = (text *) DatumGetPointer(str); diff --git a/src/backend/utils/mb/mbutils.c b/src/backend/utils/mb/mbutils.c index 4d8043dfc8..cd1ee00c10 100644 --- a/src/backend/utils/mb/mbutils.c +++ b/src/backend/utils/mb/mbutils.c @@ -4,7 +4,7 @@ * (currently mule internal code (mic) is used) * Tatsuo Ishii * - * $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.69 2008/01/09 23:43:54 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.70 2008/04/12 23:21:04 tgl Exp $ */ #include "postgres.h" @@ -313,7 +313,7 @@ pg_convert_to(PG_FUNCTION_ARGS) result = DirectFunctionCall3(pg_convert, string, src_encoding_name, dest_encoding_name); - PG_RETURN_BYTEA_P(result); + PG_RETURN_DATUM(result); } /* @@ -340,7 +340,7 @@ pg_convert_from(PG_FUNCTION_ARGS) * in this case it will be because we've told pg_convert to return one * that is valid as text in the current database encoding. */ - PG_RETURN_TEXT_P(result); + PG_RETURN_DATUM(result); } /*