From 75133d9a46e497b03772b119f5e0213f2598f937 Mon Sep 17 00:00:00 2001 From: Jan Wieck Date: Sun, 27 Feb 2000 12:02:34 +0000 Subject: [PATCH] Reactivated LZTEXT data type and changed rule plan- and qual-strings into lztext. Jan --- src/backend/utils/adt/Makefile | 4 ++-- src/backend/utils/cache/relcache.c | 8 +++---- src/include/catalog/pg_amop.h | 13 +++++++++- src/include/catalog/pg_amproc.h | 4 +++- src/include/catalog/pg_opclass.h | 4 +++- src/include/catalog/pg_operator.h | 10 +++++++- src/include/catalog/pg_proc.h | 38 +++++++++++++++++++++++++++++- src/include/catalog/pg_rewrite.h | 6 ++--- src/include/catalog/pg_type.h | 6 ++++- src/include/utils/builtins.h | 18 +++++++++++++- 10 files changed, 95 insertions(+), 16 deletions(-) diff --git a/src/backend/utils/adt/Makefile b/src/backend/utils/adt/Makefile index 030ca95178..b6b02082e0 100644 --- a/src/backend/utils/adt/Makefile +++ b/src/backend/utils/adt/Makefile @@ -4,7 +4,7 @@ # Makefile for utils/adt # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.34 2000/02/16 17:24:46 thomas Exp $ +# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.35 2000/02/27 12:02:32 wieck Exp $ # #------------------------------------------------------------------------- @@ -25,7 +25,7 @@ endif OBJS = acl.o arrayfuncs.o arrayutils.o bool.o cash.o char.o chunk.o \ date.o datetime.o datum.o filename.o float.o \ - geo_ops.o geo_selfuncs.o int.o int8.o like.o \ + geo_ops.o geo_selfuncs.o int.o int8.o like.o lztext.o \ misc.o nabstime.o name.o not_in.o numeric.o numutils.o \ oid.o oracle_compat.o \ regexp.o regproc.o ruleutils.o selfuncs.o sets.o \ diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 1615762915..74bcb10c69 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.90 2000/02/18 09:28:55 inoue Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.91 2000/02/27 12:02:32 wieck Exp $ * *------------------------------------------------------------------------- */ @@ -36,6 +36,7 @@ #include "postgres.h" +#include "utils/builtins.h" #include "access/genam.h" #include "access/heapam.h" #include "access/istrat.h" @@ -55,7 +56,6 @@ #include "miscadmin.h" #include "storage/bufmgr.h" #include "storage/smgr.h" -#include "utils/builtins.h" #include "utils/catcache.h" #include "utils/relcache.h" #include "utils/temprel.h" @@ -688,7 +688,7 @@ RelationBuildRuleLock(Relation relation) Anum_pg_rewrite_ev_action, pg_rewrite_tupdesc, &isnull); - ruleaction_str = textout((text *) DatumGetPointer(ruleaction)); + ruleaction_str = lztextout((lztext *) DatumGetPointer(ruleaction)); rule->actions = (List *) stringToNode(ruleaction_str); pfree(ruleaction_str); @@ -696,7 +696,7 @@ RelationBuildRuleLock(Relation relation) Anum_pg_rewrite_ev_qual, pg_rewrite_tupdesc, &isnull); - rule_evqual_str = textout((text *) DatumGetPointer(rule_evqual)); + rule_evqual_str = lztextout((lztext *) DatumGetPointer(rule_evqual)); rule->qual = (Node *) stringToNode(rule_evqual_str); pfree(rule_evqual_str); diff --git a/src/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h index fa43246b1c..66830cb186 100644 --- a/src/include/catalog/pg_amop.h +++ b/src/include/catalog/pg_amop.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_amop.h,v 1.30 2000/02/10 19:51:42 momjian Exp $ + * $Id: pg_amop.h,v 1.31 2000/02/27 12:02:33 wieck Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -354,6 +354,17 @@ DATA(insert OID = 0 ( 403 1690 91 3 )); DATA(insert OID = 0 ( 403 1690 1695 4 )); DATA(insert OID = 0 ( 403 1690 59 5 )); +/* + * nbtree lztext + */ + +DATA(insert OID = 0 ( 403 1663 1659 1 )); +DATA(insert OID = 0 ( 403 1663 1660 2 )); +DATA(insert OID = 0 ( 403 1663 1657 3 )); +DATA(insert OID = 0 ( 403 1663 1662 4 )); +DATA(insert OID = 0 ( 403 1663 1661 5 )); + + /* * hash table _ops */ diff --git a/src/include/catalog/pg_amproc.h b/src/include/catalog/pg_amproc.h index 6d5a150ce1..8be2a8ef96 100644 --- a/src/include/catalog/pg_amproc.h +++ b/src/include/catalog/pg_amproc.h @@ -10,7 +10,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_amproc.h,v 1.20 2000/02/10 19:51:45 momjian Exp $ + * $Id: pg_amproc.h,v 1.21 2000/02/27 12:02:33 wieck Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -100,6 +100,8 @@ DATA(insert OID = 0 (403 935 926 1)); DATA(insert OID = 0 (403 652 926 1)); DATA(insert OID = 0 (403 1768 1769 1)); DATA(insert OID = 0 (403 1690 1693 1)); +DATA(insert OID = 0 (403 1663 1636 1)); + /* hash */ diff --git a/src/include/catalog/pg_opclass.h b/src/include/catalog/pg_opclass.h index c036ef5eac..1d17f6151a 100644 --- a/src/include/catalog/pg_opclass.h +++ b/src/include/catalog/pg_opclass.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_opclass.h,v 1.29 2000/02/16 17:26:07 thomas Exp $ + * $Id: pg_opclass.h,v 1.30 2000/02/27 12:02:33 wieck Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -118,6 +118,8 @@ DATA(insert OID = 652 ( cidr_ops 650 )); DESCR(""); DATA(insert OID = 1768 ( numeric_ops 1700 )); DESCR(""); +DATA(insert OID = 1663 ( lztext_ops 1625 )); +DESCR(""); DATA(insert OID = 1690 ( bool_ops 16 )); DESCR(""); diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h index d8bc91f52e..98f0a41831 100644 --- a/src/include/catalog/pg_operator.h +++ b/src/include/catalog/pg_operator.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_operator.h,v 1.70 2000/02/24 02:05:28 tgl Exp $ + * $Id: pg_operator.h,v 1.71 2000/02/27 12:02:33 wieck Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -684,6 +684,14 @@ DATA(insert OID = 1762 ( "%" PGUID 0 b t f 1700 1700 1700 0 0 0 0 numeric DATA(insert OID = 1763 ( "@" PGUID 0 l t f 0 1700 1700 0 0 0 0 numeric_abs - - )); DATA(insert OID = 1788 ( "-" PGUID 0 l t f 0 1700 1700 0 0 0 0 numeric_uminus - - )); +/* LZTEXT type */ +DATA(insert OID = 1657 ( "=" PGUID 0 b t f 1625 1625 16 1657 1658 1659 1659 lztext_eq eqsel eqjoinsel )); +DATA(insert OID = 1658 ( "<>" PGUID 0 b t f 1625 1625 16 1658 1657 0 0 lztext_ne neqsel neqjoinsel )); +DATA(insert OID = 1659 ( "<" PGUID 0 b t f 1625 1625 16 1661 1662 0 0 lztext_lt intltsel intltjoinsel )); +DATA(insert OID = 1660 ( "<=" PGUID 0 b t f 1625 1625 16 1662 1661 0 0 lztext_le intltsel intltjoinsel )); +DATA(insert OID = 1661 ( ">" PGUID 0 b t f 1625 1625 16 1659 1660 0 0 lztext_gt intgtsel intgtjoinsel )); +DATA(insert OID = 1662 ( ">=" PGUID 0 b t f 1625 1625 16 1660 1659 0 0 lztext_ge intgtsel intgtjoinsel )); + /* * function prototypes diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index f36b2b8c97..1e8e1632c5 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_proc.h,v 1.125 2000/02/24 02:05:27 tgl Exp $ + * $Id: pg_proc.h,v 1.126 2000/02/27 12:02:33 wieck Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -2352,6 +2352,42 @@ DESCR("(internal)"); DATA(insert OID = 1787 ( int2 PGUID 11 f t t 1 f 21 "1700" 100 0 0 100 numeric_int2 - )); DESCR("(internal)"); +/* OID's 1625 - 1639 LZTEXT data type */ +DATA(insert OID = 1626 ( lztextin PGUID 11 f t t 1 f 1625 "0" 100 0 0 100 lztextin - )); +DESCR("(internal)"); +DATA(insert OID = 1627 ( lztextout PGUID 11 f t t 1 f 23 "0" 100 0 0 100 lztextout - )); +DESCR("(internal)"); +DATA(insert OID = 1628 ( lztext_text PGUID 11 f t t 1 f 25 "1625" 100 0 0 100 lztext_text -)); +DESCR("convert lztext to text"); +DATA(insert OID = 1629 ( text PGUID 11 f t t 1 f 25 "1625" 100 0 0 100 lztext_text -)); +DESCR("convert lztext to text"); +DATA(insert OID = 1630 ( text_lztext PGUID 11 f t t 1 f 1625 "25" 100 0 0 100 text_lztext -)); +DESCR("convert text to lztext"); +DATA(insert OID = 1631 ( lztext PGUID 11 f t t 1 f 1625 "25" 100 0 0 100 text_lztext -)); +DESCR("convert text to lztext"); +DATA(insert OID = 1632 ( lztextlen PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextlen - )); +DESCR("length"); +DATA(insert OID = 1633 ( length PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextlen - )); +DESCR("length"); +DATA(insert OID = 1634 ( lztextoctetlen PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextoctetlen - )); +DESCR("octet length"); +DATA(insert OID = 1635 ( octet_length PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextoctetlen - )); +DESCR("octet length"); +DATA(insert OID = 1636 ( lztext_cmp PGUID 11 f t t 2 f 23 "1625 1625" 100 0 1 0 lztext_cmp - )); +DESCR("compare lztext vs. lztext"); +DATA(insert OID = 1637 ( lztext_eq PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_eq - )); +DESCR("equal"); +DATA(insert OID = 1638 ( lztext_ne PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_ne - )); +DESCR("not equal"); +DATA(insert OID = 1639 ( lztext_gt PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_gt - )); +DESCR("greater-than"); +DATA(insert OID = 1664 ( lztext_ge PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_ge - )); +DESCR("greater-than-or-equal"); +DATA(insert OID = 1665 ( lztext_lt PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_lt - )); +DESCR("lower-than"); +DATA(insert OID = 1656 ( lztext_le PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_le - )); +DESCR("lower-than-or-equal"); + /* formatting */ DATA(insert OID = 1770 ( to_char PGUID 11 f t f 2 f 25 "1184 25" 100 0 0 100 timestamp_to_char - )); DESCR("convert / formatting timestamp to text"); diff --git a/src/include/catalog/pg_rewrite.h b/src/include/catalog/pg_rewrite.h index 8f8215589d..09e0fa7c49 100644 --- a/src/include/catalog/pg_rewrite.h +++ b/src/include/catalog/pg_rewrite.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_rewrite.h,v 1.10 2000/01/26 05:57:58 momjian Exp $ + * $Id: pg_rewrite.h,v 1.11 2000/02/27 12:02:34 wieck Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -38,8 +38,8 @@ CATALOG(pg_rewrite) Oid ev_class; int2 ev_attr; bool is_instead; - text ev_qual; - text ev_action; + lztext ev_qual; + lztext ev_action; } FormData_pg_rewrite; /* ---------------- diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h index 0a94265e5f..ae945a0f9b 100644 --- a/src/include/catalog/pg_type.h +++ b/src/include/catalog/pg_type.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_type.h,v 1.83 2000/02/21 03:36:57 tgl Exp $ + * $Id: pg_type.h,v 1.84 2000/02/27 12:02:34 wieck Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -383,6 +383,10 @@ DATA(insert OID = 1700 ( numeric PGUID -1 -1 f b t \054 0 0 numeric_in nume DESCR("numeric(precision, decimal), arbitrary precision number"); #define NUMERICOID 1700 +/* OIDS 1625 - 1639 */ +DATA(insert OID = 1625 ( lztext PGUID -1 -1 f b t \054 0 0 lztextin lztextout lztextin lztextout i _null_ )); +DESCR("variable-length string, stored compressed"); +#define LZTEXTOID 1625 #define VARLENA_FIXED_SIZE(attr) ((attr)->atttypid == BPCHAROID && (attr)->atttypmod > 0) diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 5f132cdfb6..ec3eda8629 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: builtins.h,v 1.104 2000/02/24 02:05:24 tgl Exp $ + * $Id: builtins.h,v 1.105 2000/02/27 12:02:34 wieck Exp $ * * NOTES * This should normally only be included by fmgr.h. @@ -35,6 +35,7 @@ #include "utils/timestamp.h" #include "utils/nabstime.h" #include "utils/date.h" +#include "utils/lztext.h" /* * Defined in adt/ @@ -558,6 +559,21 @@ extern float32 numeric_float4(Numeric num); extern Numeric float8_numeric(float64 val); extern float64 numeric_float8(Numeric num); +/* lztext.c */ +lztext *lztextin(char *str); +char *lztextout(lztext *lz); +text *lztext_text(lztext *lz); +lztext *text_lztext(text *txt); +int32 lztextlen(lztext *lz); +int32 lztextoctetlen(lztext *lz); +int32 lztext_cmp(lztext *lz1, lztext *lz2); +bool lztext_eq(lztext *lz1, lztext *lz2); +bool lztext_ne(lztext *lz1, lztext *lz2); +bool lztext_gt(lztext *lz1, lztext *lz2); +bool lztext_ge(lztext *lz1, lztext *lz2); +bool lztext_lt(lztext *lz1, lztext *lz2); +bool lztext_le(lztext *lz1, lztext *lz2); + /* ri_triggers.c */ extern HeapTuple RI_FKey_check_ins(FmgrInfo *proinfo); extern HeapTuple RI_FKey_check_upd(FmgrInfo *proinfo);