diff options
author | Bruce Momjian <bruce@momjian.us> | 2001-11-19 18:21:10 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2001-11-19 18:21:10 +0000 |
commit | 6f6567812e4651403eff7c945449be134848e9a5 (patch) | |
tree | 79e30e4761c65aaf425f2645921aab9f3a892de4 /src | |
parent | 9473f8d5f78bf1422b5f5b5f5e25cbe540fc2ba5 (diff) | |
download | postgresql-6f6567812e4651403eff7c945449be134848e9a5.tar.gz postgresql-6f6567812e4651403eff7c945449be134848e9a5.zip |
Make text octet_length() return non-compressed length to be consistent
with other data types, per disucssion. Encoding issue still open.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/utils/adt/varlena.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index d2e7b7d518d..08aa24def4a 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.76 2001/11/19 09:05:02 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.77 2001/11/19 18:21:10 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -256,20 +256,13 @@ textlen(PG_FUNCTION_ARGS) * textoctetlen - * returns the physical length of a text* * (which is less than the VARSIZE of the text*) - * - * XXX is it actually appropriate to return the compressed length - * when the value is compressed? It's not at all clear to me that - * this is what SQL92 has in mind ... */ Datum textoctetlen(PG_FUNCTION_ARGS) { - struct varattrib *t = (struct varattrib *) PG_GETARG_RAW_VARLENA_P(0); - - if (!VARATT_IS_EXTERNAL(t)) - PG_RETURN_INT32(VARATT_SIZE(t) - VARHDRSZ); + text *arg = PG_GETARG_VARCHAR_P(0); - PG_RETURN_INT32(t->va_content.va_external.va_extsize); + PG_RETURN_INT32(VARSIZE(arg) - VARHDRSZ); } /* |