Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5c2fb2a

Browse files
committed
Use symbolic INDEX_MAX_KEYS in pg_type entries for oidvector
and int2vector.
1 parentc2fa275 commit5c2fb2a

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

‎src/backend/catalog/genbki.sh.in

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
#
1212
# IDENTIFICATION
13-
# $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh.in,v 1.4 1999/11/04 08:00:56 inoue Exp $
13+
# $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh.in,v 1.5 2000/01/11 04:02:28 tgl Exp $
1414
#
1515
# NOTES
1616
# non-essential whitespace is removed from the generated file.
@@ -53,7 +53,17 @@ while test $x -le $numargs ; do
5353
done
5454

5555
# Get NAMEDATALEN from postgres_ext.h
56-
NAMEDATALEN=`grep'#define.*NAMEDATALEN' ../../include/postgres_ext.h| awk'{ print $3 }'`
56+
NAMEDATALEN=`grep'#define[ ]*NAMEDATALEN' ../../include/postgres_ext.h| awk'{ print $3 }'`
57+
58+
# Get INDEX_MAX_KEYS from config.h (who needs consistency?)
59+
INDEXMAXKEYS=`grep'#define[ ]*INDEX_MAX_KEYS' ../../include/config.h| awk'{ print $3 }'`
60+
61+
# NOTE: we assume here that FUNC_MAX_ARGS has the same value as INDEX_MAX_KEYS,
62+
# and don't read it separately from config.h. This is OK because both of them
63+
# must be equal to the length of oidvector.
64+
65+
INDEXMAXKEYS2=`expr$INDEXMAXKEYS'*' 2`
66+
INDEXMAXKEYS4=`expr$INDEXMAXKEYS'*' 4`
5767

5868
# ----------------
5969
# strip comments and trash from .h before we generate
@@ -80,6 +90,12 @@ sed -e "s/;[ ]*$//g" \
8090
-e"s/(NameData/(name/g" \
8191
-e"s/(Oid/(oid/g" \
8292
-e"s/NAMEDATALEN/$NAMEDATALEN/g" \
93+
-e"s/INDEX_MAX_KEYS\*2/$INDEXMAXKEYS2/g" \
94+
-e"s/INDEX_MAX_KEYS\*4/$INDEXMAXKEYS4/g" \
95+
-e"s/INDEX_MAX_KEYS/$INDEXMAXKEYS/g" \
96+
-e"s/FUNC_MAX_ARGS\*2/$INDEXMAXKEYS2/g" \
97+
-e"s/FUNC_MAX_ARGS\*4/$INDEXMAXKEYS4/g" \
98+
-e"s/FUNC_MAX_ARGS/$INDEXMAXKEYS/g" \
8399
| awk'
84100
# ----------------
85101
#now use awk to process remaining .h file..

‎src/include/catalog/pg_type.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: pg_type.h,v 1.74 2000/01/10 20:23:31 momjian Exp $
10+
* $Id: pg_type.h,v 1.75 2000/01/11 04:02:28 tgl Exp $
1111
*
1212
* NOTES
1313
* 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
174174
DESCR("-32 thousand to 32 thousand, 2-byte storage");
175175
#defineINT2OID21
176176

177-
DATA(insertOID=22 (int2vectorPGUID32113fbt \054021int2vectorinint2vectoroutint2vectorinint2vectorouti_null_ ));
178-
DESCR("16int2 integers, usedinternally");
177+
DATA(insertOID=22 (int2vectorPGUIDINDEX_MAX_KEYS*2-1fbt \054021int2vectorinint2vectoroutint2vectorinint2vectorouti_null_ ));
178+
DESCR("array of INDEX_MAX_KEYSint2 integers, usedin system tables");
179179
/*
180180
* XXX -- the implementation of int2vector's in postgres is a hack, and will
181181
* 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
213213
DESCR("command identifier type, sequence in transaction id");
214214
#defineCIDOID 29
215215

216-
DATA(insertOID=30 (oidvectorPGUID64193fbt \054026oidvectorinoidvectoroutoidvectorinoidvectorouti_null_ ));
217-
DESCR("array of16 oids, used in system tables");
216+
DATA(insertOID=30 (oidvectorPGUIDINDEX_MAX_KEYS*4-1fbt \054026oidvectorinoidvectoroutoidvectorinoidvectorouti_null_ ));
217+
DESCR("array ofINDEX_MAX_KEYS oids, used in system tables");
218218
DATA(insertOID=32 (SETPGUID-1-1fbt \05400textintextouttextintextouti_null_ ));
219219
DESCR("set of tuples");
220220

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp