Skip to content

Commit 75133d9

Browse files
Jan WieckJan Wieck
authored andcommitted
Reactivated LZTEXT data type and changed rule plan- and qual-strings
into lztext. Jan
1 parent 97e38d3 commit 75133d9

File tree

10 files changed

+95
-16
lines changed

10 files changed

+95
-16
lines changed

src/backend/utils/adt/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for utils/adt
55
#
66
# IDENTIFICATION
7-
# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.34 2000/02/16 17:24:46 thomas Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.35 2000/02/27 12:02:32 wieck Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -25,7 +25,7 @@ endif
2525

2626
OBJS = acl.o arrayfuncs.o arrayutils.o bool.o cash.o char.o chunk.o \
2727
date.o datetime.o datum.o filename.o float.o \
28-
geo_ops.o geo_selfuncs.o int.o int8.o like.o \
28+
geo_ops.o geo_selfuncs.o int.o int8.o like.o lztext.o \
2929
misc.o nabstime.o name.o not_in.o numeric.o numutils.o \
3030
oid.o oracle_compat.o \
3131
regexp.o regproc.o ruleutils.o selfuncs.o sets.o \

src/backend/utils/cache/relcache.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.90 2000/02/18 09:28:55 inoue Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.91 2000/02/27 12:02:32 wieck Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -36,6 +36,7 @@
3636

3737
#include "postgres.h"
3838

39+
#include "utils/builtins.h"
3940
#include "access/genam.h"
4041
#include "access/heapam.h"
4142
#include "access/istrat.h"
@@ -55,7 +56,6 @@
5556
#include "miscadmin.h"
5657
#include "storage/bufmgr.h"
5758
#include "storage/smgr.h"
58-
#include "utils/builtins.h"
5959
#include "utils/catcache.h"
6060
#include "utils/relcache.h"
6161
#include "utils/temprel.h"
@@ -688,15 +688,15 @@ RelationBuildRuleLock(Relation relation)
688688
Anum_pg_rewrite_ev_action,
689689
pg_rewrite_tupdesc,
690690
&isnull);
691-
ruleaction_str = textout((text *) DatumGetPointer(ruleaction));
691+
ruleaction_str = lztextout((lztext *) DatumGetPointer(ruleaction));
692692
rule->actions = (List *) stringToNode(ruleaction_str);
693693
pfree(ruleaction_str);
694694

695695
rule_evqual = heap_getattr(pg_rewrite_tuple,
696696
Anum_pg_rewrite_ev_qual,
697697
pg_rewrite_tupdesc,
698698
&isnull);
699-
rule_evqual_str = textout((text *) DatumGetPointer(rule_evqual));
699+
rule_evqual_str = lztextout((lztext *) DatumGetPointer(rule_evqual));
700700
rule->qual = (Node *) stringToNode(rule_evqual_str);
701701
pfree(rule_evqual_str);
702702

src/include/catalog/pg_amop.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: pg_amop.h,v 1.30 2000/02/10 19:51:42 momjian Exp $
11+
* $Id: pg_amop.h,v 1.31 2000/02/27 12:02:33 wieck Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -354,6 +354,17 @@ DATA(insert OID = 0 ( 403 1690 91 3 ));
354354
DATA(insert OID = 0 ( 403 1690 1695 4 ));
355355
DATA(insert OID = 0 ( 403 1690 59 5 ));
356356

357+
/*
358+
* nbtree lztext
359+
*/
360+
361+
DATA(insert OID = 0 ( 403 1663 1659 1 ));
362+
DATA(insert OID = 0 ( 403 1663 1660 2 ));
363+
DATA(insert OID = 0 ( 403 1663 1657 3 ));
364+
DATA(insert OID = 0 ( 403 1663 1662 4 ));
365+
DATA(insert OID = 0 ( 403 1663 1661 5 ));
366+
367+
357368
/*
358369
* hash table _ops
359370
*/

src/include/catalog/pg_amproc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
1111
* Portions Copyright (c) 1994, Regents of the University of California
1212
*
13-
* $Id: pg_amproc.h,v 1.20 2000/02/10 19:51:45 momjian Exp $
13+
* $Id: pg_amproc.h,v 1.21 2000/02/27 12:02:33 wieck Exp $
1414
*
1515
* NOTES
1616
* the genbki.sh script reads this file and generates .bki
@@ -100,6 +100,8 @@ DATA(insert OID = 0 (403 935 926 1));
100100
DATA(insert OID = 0 (403 652 926 1));
101101
DATA(insert OID = 0 (403 1768 1769 1));
102102
DATA(insert OID = 0 (403 1690 1693 1));
103+
DATA(insert OID = 0 (403 1663 1636 1));
104+
103105

104106

105107
/* hash */

src/include/catalog/pg_opclass.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: pg_opclass.h,v 1.29 2000/02/16 17:26:07 thomas Exp $
11+
* $Id: pg_opclass.h,v 1.30 2000/02/27 12:02:33 wieck Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -118,6 +118,8 @@ DATA(insert OID = 652 ( cidr_ops 650 ));
118118
DESCR("");
119119
DATA(insert OID = 1768 ( numeric_ops 1700 ));
120120
DESCR("");
121+
DATA(insert OID = 1663 ( lztext_ops 1625 ));
122+
DESCR("");
121123
DATA(insert OID = 1690 ( bool_ops 16 ));
122124
DESCR("");
123125

src/include/catalog/pg_operator.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: pg_operator.h,v 1.70 2000/02/24 02:05:28 tgl Exp $
11+
* $Id: pg_operator.h,v 1.71 2000/02/27 12:02:33 wieck Exp $
1212
*
1313
* NOTES
1414
* 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
684684
DATA(insert OID = 1763 ( "@" PGUID 0 l t f 0 1700 1700 0 0 0 0 numeric_abs - - ));
685685
DATA(insert OID = 1788 ( "-" PGUID 0 l t f 0 1700 1700 0 0 0 0 numeric_uminus - - ));
686686

687+
/* LZTEXT type */
688+
DATA(insert OID = 1657 ( "=" PGUID 0 b t f 1625 1625 16 1657 1658 1659 1659 lztext_eq eqsel eqjoinsel ));
689+
DATA(insert OID = 1658 ( "<>" PGUID 0 b t f 1625 1625 16 1658 1657 0 0 lztext_ne neqsel neqjoinsel ));
690+
DATA(insert OID = 1659 ( "<" PGUID 0 b t f 1625 1625 16 1661 1662 0 0 lztext_lt intltsel intltjoinsel ));
691+
DATA(insert OID = 1660 ( "<=" PGUID 0 b t f 1625 1625 16 1662 1661 0 0 lztext_le intltsel intltjoinsel ));
692+
DATA(insert OID = 1661 ( ">" PGUID 0 b t f 1625 1625 16 1659 1660 0 0 lztext_gt intgtsel intgtjoinsel ));
693+
DATA(insert OID = 1662 ( ">=" PGUID 0 b t f 1625 1625 16 1660 1659 0 0 lztext_ge intgtsel intgtjoinsel ));
694+
687695

688696
/*
689697
* function prototypes

src/include/catalog/pg_proc.h

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: pg_proc.h,v 1.125 2000/02/24 02:05:27 tgl Exp $
10+
* $Id: pg_proc.h,v 1.126 2000/02/27 12:02:33 wieck Exp $
1111
*
1212
* NOTES
1313
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2352,6 +2352,42 @@ DESCR("(internal)");
23522352
DATA(insert OID = 1787 ( int2 PGUID 11 f t t 1 f 21 "1700" 100 0 0 100 numeric_int2 - ));
23532353
DESCR("(internal)");
23542354

2355+
/* OID's 1625 - 1639 LZTEXT data type */
2356+
DATA(insert OID = 1626 ( lztextin PGUID 11 f t t 1 f 1625 "0" 100 0 0 100 lztextin - ));
2357+
DESCR("(internal)");
2358+
DATA(insert OID = 1627 ( lztextout PGUID 11 f t t 1 f 23 "0" 100 0 0 100 lztextout - ));
2359+
DESCR("(internal)");
2360+
DATA(insert OID = 1628 ( lztext_text PGUID 11 f t t 1 f 25 "1625" 100 0 0 100 lztext_text -));
2361+
DESCR("convert lztext to text");
2362+
DATA(insert OID = 1629 ( text PGUID 11 f t t 1 f 25 "1625" 100 0 0 100 lztext_text -));
2363+
DESCR("convert lztext to text");
2364+
DATA(insert OID = 1630 ( text_lztext PGUID 11 f t t 1 f 1625 "25" 100 0 0 100 text_lztext -));
2365+
DESCR("convert text to lztext");
2366+
DATA(insert OID = 1631 ( lztext PGUID 11 f t t 1 f 1625 "25" 100 0 0 100 text_lztext -));
2367+
DESCR("convert text to lztext");
2368+
DATA(insert OID = 1632 ( lztextlen PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextlen - ));
2369+
DESCR("length");
2370+
DATA(insert OID = 1633 ( length PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextlen - ));
2371+
DESCR("length");
2372+
DATA(insert OID = 1634 ( lztextoctetlen PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextoctetlen - ));
2373+
DESCR("octet length");
2374+
DATA(insert OID = 1635 ( octet_length PGUID 11 f t t 1 f 23 "1625" 100 0 1 0 lztextoctetlen - ));
2375+
DESCR("octet length");
2376+
DATA(insert OID = 1636 ( lztext_cmp PGUID 11 f t t 2 f 23 "1625 1625" 100 0 1 0 lztext_cmp - ));
2377+
DESCR("compare lztext vs. lztext");
2378+
DATA(insert OID = 1637 ( lztext_eq PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_eq - ));
2379+
DESCR("equal");
2380+
DATA(insert OID = 1638 ( lztext_ne PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_ne - ));
2381+
DESCR("not equal");
2382+
DATA(insert OID = 1639 ( lztext_gt PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_gt - ));
2383+
DESCR("greater-than");
2384+
DATA(insert OID = 1664 ( lztext_ge PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_ge - ));
2385+
DESCR("greater-than-or-equal");
2386+
DATA(insert OID = 1665 ( lztext_lt PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_lt - ));
2387+
DESCR("lower-than");
2388+
DATA(insert OID = 1656 ( lztext_le PGUID 11 f t t 2 f 16 "1625 1625" 100 0 1 0 lztext_le - ));
2389+
DESCR("lower-than-or-equal");
2390+
23552391
/* formatting */
23562392
DATA(insert OID = 1770 ( to_char PGUID 11 f t f 2 f 25 "1184 25" 100 0 0 100 timestamp_to_char - ));
23572393
DESCR("convert / formatting timestamp to text");

src/include/catalog/pg_rewrite.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: pg_rewrite.h,v 1.10 2000/01/26 05:57:58 momjian Exp $
11+
* $Id: pg_rewrite.h,v 1.11 2000/02/27 12:02:34 wieck Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -38,8 +38,8 @@ CATALOG(pg_rewrite)
3838
Oid ev_class;
3939
int2 ev_attr;
4040
bool is_instead;
41-
text ev_qual;
42-
text ev_action;
41+
lztext ev_qual;
42+
lztext ev_action;
4343
} FormData_pg_rewrite;
4444

4545
/* ----------------

src/include/catalog/pg_type.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: pg_type.h,v 1.83 2000/02/21 03:36:57 tgl Exp $
11+
* $Id: pg_type.h,v 1.84 2000/02/27 12:02:34 wieck Exp $
1212
*
1313
* NOTES
1414
* 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
383383
DESCR("numeric(precision, decimal), arbitrary precision number");
384384
#define NUMERICOID 1700
385385

386+
/* OIDS 1625 - 1639 */
387+
DATA(insert OID = 1625 ( lztext PGUID -1 -1 f b t \054 0 0 lztextin lztextout lztextin lztextout i _null_ ));
388+
DESCR("variable-length string, stored compressed");
389+
#define LZTEXTOID 1625
386390

387391
#define VARLENA_FIXED_SIZE(attr) ((attr)->atttypid == BPCHAROID && (attr)->atttypmod > 0)
388392

src/include/utils/builtins.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: builtins.h,v 1.104 2000/02/24 02:05:24 tgl Exp $
10+
* $Id: builtins.h,v 1.105 2000/02/27 12:02:34 wieck Exp $
1111
*
1212
* NOTES
1313
* This should normally only be included by fmgr.h.
@@ -35,6 +35,7 @@
3535
#include "utils/timestamp.h"
3636
#include "utils/nabstime.h"
3737
#include "utils/date.h"
38+
#include "utils/lztext.h"
3839

3940
/*
4041
* Defined in adt/
@@ -558,6 +559,21 @@ extern float32 numeric_float4(Numeric num);
558559
extern Numeric float8_numeric(float64 val);
559560
extern float64 numeric_float8(Numeric num);
560561

562+
/* lztext.c */
563+
lztext *lztextin(char *str);
564+
char *lztextout(lztext *lz);
565+
text *lztext_text(lztext *lz);
566+
lztext *text_lztext(text *txt);
567+
int32 lztextlen(lztext *lz);
568+
int32 lztextoctetlen(lztext *lz);
569+
int32 lztext_cmp(lztext *lz1, lztext *lz2);
570+
bool lztext_eq(lztext *lz1, lztext *lz2);
571+
bool lztext_ne(lztext *lz1, lztext *lz2);
572+
bool lztext_gt(lztext *lz1, lztext *lz2);
573+
bool lztext_ge(lztext *lz1, lztext *lz2);
574+
bool lztext_lt(lztext *lz1, lztext *lz2);
575+
bool lztext_le(lztext *lz1, lztext *lz2);
576+
561577
/* ri_triggers.c */
562578
extern HeapTuple RI_FKey_check_ins(FmgrInfo *proinfo);
563579
extern HeapTuple RI_FKey_check_upd(FmgrInfo *proinfo);

0 commit comments

Comments
 (0)