Use symbolic INDEX_MAX_KEYS in pg_type entries for oidvector
and int2vector.
This commit is contained in:
parent
c2fa275d20
commit
5c2fb2a1e2
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh.in,v 1.4 1999/11/04 08:00:56 inoue Exp $
|
# $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh.in,v 1.5 2000/01/11 04:02:28 tgl Exp $
|
||||||
#
|
#
|
||||||
# NOTES
|
# NOTES
|
||||||
# non-essential whitespace is removed from the generated file.
|
# non-essential whitespace is removed from the generated file.
|
||||||
|
@ -53,7 +53,17 @@ while test $x -le $numargs ; do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Get NAMEDATALEN from postgres_ext.h
|
# Get NAMEDATALEN from postgres_ext.h
|
||||||
NAMEDATALEN=`grep '#define.*NAMEDATALEN' ../../include/postgres_ext.h | awk '{ print $3 }'`
|
NAMEDATALEN=`grep '#define[ ]*NAMEDATALEN' ../../include/postgres_ext.h | awk '{ print $3 }'`
|
||||||
|
|
||||||
|
# Get INDEX_MAX_KEYS from config.h (who needs consistency?)
|
||||||
|
INDEXMAXKEYS=`grep '#define[ ]*INDEX_MAX_KEYS' ../../include/config.h | awk '{ print $3 }'`
|
||||||
|
|
||||||
|
# NOTE: we assume here that FUNC_MAX_ARGS has the same value as INDEX_MAX_KEYS,
|
||||||
|
# and don't read it separately from config.h. This is OK because both of them
|
||||||
|
# must be equal to the length of oidvector.
|
||||||
|
|
||||||
|
INDEXMAXKEYS2=`expr $INDEXMAXKEYS '*' 2`
|
||||||
|
INDEXMAXKEYS4=`expr $INDEXMAXKEYS '*' 4`
|
||||||
|
|
||||||
# ----------------
|
# ----------------
|
||||||
# strip comments and trash from .h before we generate
|
# strip comments and trash from .h before we generate
|
||||||
|
@ -80,6 +90,12 @@ sed -e "s/;[ ]*$//g" \
|
||||||
-e "s/(NameData/(name/g" \
|
-e "s/(NameData/(name/g" \
|
||||||
-e "s/(Oid/(oid/g" \
|
-e "s/(Oid/(oid/g" \
|
||||||
-e "s/NAMEDATALEN/$NAMEDATALEN/g" \
|
-e "s/NAMEDATALEN/$NAMEDATALEN/g" \
|
||||||
|
-e "s/INDEX_MAX_KEYS\*2/$INDEXMAXKEYS2/g" \
|
||||||
|
-e "s/INDEX_MAX_KEYS\*4/$INDEXMAXKEYS4/g" \
|
||||||
|
-e "s/INDEX_MAX_KEYS/$INDEXMAXKEYS/g" \
|
||||||
|
-e "s/FUNC_MAX_ARGS\*2/$INDEXMAXKEYS2/g" \
|
||||||
|
-e "s/FUNC_MAX_ARGS\*4/$INDEXMAXKEYS4/g" \
|
||||||
|
-e "s/FUNC_MAX_ARGS/$INDEXMAXKEYS/g" \
|
||||||
| awk '
|
| awk '
|
||||||
# ----------------
|
# ----------------
|
||||||
# now use awk to process remaining .h file..
|
# now use awk to process remaining .h file..
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: pg_type.h,v 1.74 2000/01/10 20:23:31 momjian Exp $
|
* $Id: pg_type.h,v 1.75 2000/01/11 04:02:28 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* the genbki.sh script reads this file and generates .bki
|
* the genbki.sh script reads this file and generates .bki
|
||||||
|
@ -174,8 +174,8 @@ DATA(insert OID = 21 ( int2 PGUID 2 5 t b t \054 0 0 int2in int2out int2
|
||||||
DESCR("-32 thousand to 32 thousand, 2-byte storage");
|
DESCR("-32 thousand to 32 thousand, 2-byte storage");
|
||||||
#define INT2OID 21
|
#define INT2OID 21
|
||||||
|
|
||||||
DATA(insert OID = 22 ( int2vector PGUID 32 113 f b t \054 0 21 int2vectorin int2vectorout int2vectorin int2vectorout i _null_ ));
|
DATA(insert OID = 22 ( int2vector PGUID INDEX_MAX_KEYS*2 -1 f b t \054 0 21 int2vectorin int2vectorout int2vectorin int2vectorout i _null_ ));
|
||||||
DESCR("16 int2 integers, used internally");
|
DESCR("array of INDEX_MAX_KEYS int2 integers, used in system tables");
|
||||||
/*
|
/*
|
||||||
* XXX -- the implementation of int2vector's in postgres is a hack, and will
|
* XXX -- the implementation of int2vector's in postgres is a hack, and will
|
||||||
* go away someday. until that happens, there is a case (in the
|
* go away someday. until that happens, there is a case (in the
|
||||||
|
@ -213,8 +213,8 @@ DATA(insert OID = 29 ( cid PGUID 4 10 t b t \054 0 0 cidin cidout cidin
|
||||||
DESCR("command identifier type, sequence in transaction id");
|
DESCR("command identifier type, sequence in transaction id");
|
||||||
#define CIDOID 29
|
#define CIDOID 29
|
||||||
|
|
||||||
DATA(insert OID = 30 ( oidvector PGUID 64 193 f b t \054 0 26 oidvectorin oidvectorout oidvectorin oidvectorout i _null_ ));
|
DATA(insert OID = 30 ( oidvector PGUID INDEX_MAX_KEYS*4 -1 f b t \054 0 26 oidvectorin oidvectorout oidvectorin oidvectorout i _null_ ));
|
||||||
DESCR("array of 16 oids, used in system tables");
|
DESCR("array of INDEX_MAX_KEYS oids, used in system tables");
|
||||||
DATA(insert OID = 32 ( SET PGUID -1 -1 f b t \054 0 0 textin textout textin textout i _null_ ));
|
DATA(insert OID = 32 ( SET PGUID -1 -1 f b t \054 0 0 textin textout textin textout i _null_ ));
|
||||||
DESCR("set of tuples");
|
DESCR("set of tuples");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue