diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-05-03 19:10:48 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-05-03 19:10:48 +0000 |
commit | 210055ad614ae845686fdf9f8fc6b60301689cc8 (patch) | |
tree | 0410cff48a92bc3c95aea12877046d4ab25aaedb /src/backend/utils/adt/varchar.c | |
parent | da5f1dd7227bd507cc8d5b088fd3f5e53e932722 (diff) |
here are some patches for 6.5.0 which I already submitted but have never
been applied. The patches are in the .tar.gz attachment at the end:
varchar-array.patch this patch adds support for arrays of bpchar() and
varchar(), which where always missing from postgres.
These datatypes can be used to replace the _char4,
_char8, etc., which were dropped some time ago.
block-size.patch this patch fixes many errors in the parser and other
program which happen with very large query statements
(> 8K) when using a page size larger than 8192.
This patch is needed if you want to submit queries
larger than 8K. Postgres supports tuples up to 32K
but you can't insert them because you can't submit
queries larger than 8K. My patch fixes this problem.
The patch also replaces all the occurrences of `8192'
and `1<<13' in the sources with the proper constants
defined in include files. You should now never find
8192 hardwired in C code, just to make code clearer.
--
Massimo Dal Zotto
Diffstat (limited to 'src/backend/utils/adt/varchar.c')
-rw-r--r-- | src/backend/utils/adt/varchar.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/backend/utils/adt/varchar.c b/src/backend/utils/adt/varchar.c index 8a06e6f4fd0..0aa8133b131 100644 --- a/src/backend/utils/adt/varchar.c +++ b/src/backend/utils/adt/varchar.c @@ -7,14 +7,16 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.43 1999/02/13 23:19:35 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.44 1999/05/03 19:10:02 momjian Exp $ * *------------------------------------------------------------------------- */ #include <stdio.h> /* for sprintf() */ #include <string.h> #include "postgres.h" +#include "utils/array.h" #include "utils/builtins.h" +#include "catalog/pg_type.h" #ifdef CYR_RECODE char *convertstr(char *, int, int); @@ -200,6 +202,16 @@ bpchar(char *s, int32 len) return result; } /* bpchar() */ +/* _bpchar() + * Converts an array of char() type to a specific internal length. + * len is the length specified in () plus VARHDRSZ bytes. + */ +ArrayType * +_bpchar(ArrayType *v, int32 len) +{ + return array_map(v, BPCHAROID, bpchar, BPCHAROID, 1, len); +} + /* bpchar_char() * Convert bpchar(1) to char. @@ -396,6 +408,16 @@ varchar(char *s, int32 slen) return result; } /* varchar() */ +/* _varchar() + * Converts an array of varchar() type to the specified size. + * len is the length specified in () plus VARHDRSZ bytes. + */ +ArrayType * +_varchar(ArrayType *v, int32 len) +{ + return array_map(v, VARCHAROID, varchar, VARCHAROID, 1, len); +} + /***************************************************************************** * Comparison Functions used for bpchar |