diff options
author | Bruce Momjian | 1999-05-03 19:10:48 +0000 |
---|---|---|
committer | Bruce Momjian | 1999-05-03 19:10:48 +0000 |
commit | 210055ad614ae845686fdf9f8fc6b60301689cc8 (patch) | |
tree | 0410cff48a92bc3c95aea12877046d4ab25aaedb /src/include | |
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/include')
-rw-r--r-- | src/include/catalog/pg_proc.h | 7 | ||||
-rw-r--r-- | src/include/catalog/pg_type.h | 4 | ||||
-rw-r--r-- | src/include/libpq/pqcomm.h | 7 | ||||
-rw-r--r-- | src/include/miscadmin.h | 5 | ||||
-rw-r--r-- | src/include/postgres.h | 3 | ||||
-rw-r--r-- | src/include/utils/array.h | 6 | ||||
-rw-r--r-- | src/include/utils/builtins.h | 5 |
7 files changed, 28 insertions, 9 deletions
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 76f9bbf8160..5b5687dfbd3 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_proc.h,v 1.96 1999/04/20 03:51:13 tgl Exp $ + * $Id: pg_proc.h,v 1.97 1999/05/03 19:10:18 momjian Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -1553,6 +1553,11 @@ DESCR("convert int8 to text"); DATA(insert OID = 1289 ( text_int8 PGUID 11 f t f 1 f 20 "25" 100 0 0 100 text_int8 - )); DESCR("convert text to int8"); +DATA(insert OID = 1290 ( _bpchar PGUID 11 f t f 2 f 1014 "1014 23" 100 0 0 100 _bpchar - )); +DESCR("truncate _char()"); +DATA(insert OID = 1291 ( _varchar PGUID 11 f t f 2 f 1015 "1015 23" 100 0 0 100 _varchar - )); +DESCR("truncate _varchar()"); + DATA(insert OID = 1297 ( timestamp_in PGUID 11 f t f 1 f 1296 "0" 100 0 0 100 timestamp_in - )); DESCR("(internal)"); DATA(insert OID = 1298 ( timestamp_out PGUID 11 f t f 1 f 23 "0" 100 0 0 100 timestamp_out - )); diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h index 49d5e011832..aa8d703ad2c 100644 --- a/src/include/catalog/pg_type.h +++ b/src/include/catalog/pg_type.h @@ -7,7 +7,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pg_type.h,v 1.58 1999/03/28 02:01:39 tgl Exp $ + * $Id: pg_type.h,v 1.59 1999/05/03 19:10:20 momjian Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -327,6 +327,8 @@ DATA(insert OID = 1010 ( _tid PGUID -1 -1 f b t \054 0 27 array_in array_out DATA(insert OID = 1011 ( _xid PGUID -1 -1 f b t \054 0 28 array_in array_out array_in array_out i _null_ )); DATA(insert OID = 1012 ( _cid PGUID -1 -1 f b t \054 0 29 array_in array_out array_in array_out i _null_ )); DATA(insert OID = 1013 ( _oid8 PGUID -1 -1 f b t \054 0 30 array_in array_out array_in array_out i _null_ )); +DATA(insert OID = 1014 ( _bpchar PGUID -1 -1 f b t \054 0 1042 array_in array_out array_in array_out i _null_ )); +DATA(insert OID = 1015 ( _varchar PGUID -1 -1 f b t \054 0 1043 array_in array_out array_in array_out i _null_ )); DATA(insert OID = 1017 ( _point PGUID -1 -1 f b t \054 0 600 array_in array_out array_in array_out d _null_ )); DATA(insert OID = 1018 ( _lseg PGUID -1 -1 f b t \054 0 601 array_in array_out array_in array_out d _null_ )); DATA(insert OID = 1019 ( _path PGUID -1 -1 f b t \054 0 602 array_in array_out array_in array_out d _null_ )); diff --git a/src/include/libpq/pqcomm.h b/src/include/libpq/pqcomm.h index 53542993d87..12024b720f4 100644 --- a/src/include/libpq/pqcomm.h +++ b/src/include/libpq/pqcomm.h @@ -8,7 +8,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: pqcomm.h,v 1.34 1999/04/25 03:19:13 tgl Exp $ + * $Id: pqcomm.h,v 1.35 1999/05/03 19:10:24 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -27,6 +27,11 @@ #include <netinet/in.h> #endif +/* + * Internal send/receive buffers in libpq. + */ +#define PQ_BUFFER_SIZE 8192 + /* Define a generic socket address type. */ typedef union SockAddr diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index fa5397f070e..1cec52a1a89 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -11,7 +11,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: miscadmin.h,v 1.36 1999/03/17 22:53:30 momjian Exp $ + * $Id: miscadmin.h,v 1.37 1999/05/03 19:10:09 momjian Exp $ * * NOTES * some of the information in this file will be moved to @@ -100,7 +100,8 @@ extern int SortMem; extern Oid LastOidProcessed; /* for query rewrite */ -#define MAX_PARSE_BUFFER 8192 +/* #define MAX_QUERY_SIZE (BLCKSZ*2) */ +#define MAX_PARSE_BUFFER MAX_QUERY_SIZE /* * default number of buffers in buffer pool diff --git a/src/include/postgres.h b/src/include/postgres.h index ab57059295f..1edaf853988 100644 --- a/src/include/postgres.h +++ b/src/include/postgres.h @@ -6,7 +6,7 @@ * * Copyright (c) 1995, Regents of the University of California * - * $Id: postgres.h,v 1.21 1999/03/25 03:49:28 tgl Exp $ + * $Id: postgres.h,v 1.22 1999/05/03 19:10:14 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -151,6 +151,7 @@ typedef uint32 CommandId; * ---------------- */ #define MAXPGPATH 128 +#define MAX_QUERY_SIZE (BLCKSZ*2) #define STATUS_OK (0) #define STATUS_ERROR (-1) diff --git a/src/include/utils/array.h b/src/include/utils/array.h index 833727e07fb..7ea945bf5fb 100644 --- a/src/include/utils/array.h +++ b/src/include/utils/array.h @@ -10,7 +10,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: array.h,v 1.15 1999/02/13 23:22:15 momjian Exp $ + * $Id: array.h,v 1.16 1999/05/03 19:10:25 momjian Exp $ * * NOTES * XXX the data array should be LONGALIGN'd -- notice that the array @@ -103,7 +103,7 @@ typedef struct #define RETURN_NULL {*isNull = true; return(0); } /* #endif *//* irix5 */ #define NAME_LEN 30 -#define MAX_BUFF_SIZE (1 << 13) +#define MAX_BUFF_SIZE BLCKSZ typedef struct { @@ -126,6 +126,8 @@ extern char *array_set(ArrayType *array, int n, int *indx, char *dataPtr, extern char *array_assgn(ArrayType *array, int n, int *upperIndx, int *lowerIndx, ArrayType *newArr, int reftype, int len, bool *isNull); +extern ArrayType *array_map(ArrayType *v, Oid type, char *(fn)(char *p, ...), + Oid retType, int nargs, ...); extern int array_eq(ArrayType *array1, ArrayType *array2); extern int _LOtransfer(char **destfd, int size, int nitems, char **srcfd, int isSrcLO, int isDestLO); diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 47dbef4c67b..71fb63c77fe 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: builtins.h,v 1.77 1999/03/15 03:24:31 tgl Exp $ + * $Id: builtins.h,v 1.78 1999/05/03 19:10:31 momjian Exp $ * * NOTES * This should normally only be included by fmgr.h. @@ -23,6 +23,7 @@ #define BUILTINS_H #include <storage/itemptr.h> +#include <utils/array.h> #include <utils/geo_decls.h> #include <utils/datetime.h> #include <utils/nabstime.h> @@ -411,6 +412,7 @@ time_t datetime_timestamp(DateTime *datetime); extern char *bpcharin(char *s, int dummy, int32 atttypmod); extern char *bpcharout(char *s); extern char *bpchar(char *s, int32 slen); +extern ArrayType *_bpchar(ArrayType *v, int32 slen); extern char *char_bpchar(int32 c); extern int32 bpchar_char(char *s); extern char *name_bpchar(NameData *s); @@ -429,6 +431,7 @@ extern uint32 hashbpchar(struct varlena * key); extern char *varcharin(char *s, int dummy, int32 atttypmod); extern char *varcharout(char *s); extern char *varchar(char *s, int32 slen); +extern ArrayType *_varchar(ArrayType *v, int32 slen); extern bool varchareq(char *arg1, char *arg2); extern bool varcharne(char *arg1, char *arg2); extern bool varcharlt(char *arg1, char *arg2); |