Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
b99f3006
Commit
b99f3006
authored
25 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Move INDEX_MAX_KEYS to postgres.h, and make it configurable for users.
parent
8cc9d845
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/backend/utils/adt/oid.c
+20
-23
20 additions, 23 deletions
src/backend/utils/adt/oid.c
src/include/catalog/pg_index.h
+1
-4
1 addition, 4 deletions
src/include/catalog/pg_index.h
src/include/postgres.h
+5
-3
5 additions, 3 deletions
src/include/postgres.h
with
26 additions
and
30 deletions
src/backend/utils/adt/oid.c
+
20
−
23
View file @
b99f3006
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.2
8 1999
/0
7
/1
7 20:17:58
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.2
9 2000
/0
1
/1
0 04:36:34
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -30,26 +30,23 @@ Oid *
...
@@ -30,26 +30,23 @@ Oid *
oid8in
(
char
*
oidString
)
oid8in
(
char
*
oidString
)
{
{
Oid
*
result
;
Oid
*
result
;
int
nums
;
int
slot
;
if
(
oidString
==
NULL
)
if
(
oidString
==
NULL
)
return
NULL
;
return
NULL
;
result
=
(
Oid
*
)
palloc
(
sizeof
(
Oid
[
8
]));
result
=
(
Oid
*
)
palloc
(
sizeof
(
Oid
[
INDEX_MAX_KEYS
]));
if
((
nums
=
sscanf
(
oidString
,
"%u%u%u%u%u%u%u%u"
,
&
result
[
0
],
for
(
slot
=
0
;
*
oidString
&&
slot
<
INDEX_MAX_KEYS
;
slot
++
)
&
result
[
1
],
&
result
[
2
],
&
result
[
3
],
&
result
[
4
],
&
result
[
5
],
&
result
[
6
],
&
result
[
7
]))
!=
8
)
{
{
do
if
(
sscanf
(
oidString
,
"%u"
,
&
result
[
slot
])
!=
1
)
result
[
nums
++
]
=
0
;
break
;
while
(
nums
<
8
);
while
(
*
oidString
&&
*
oidString
!=
' '
)
oidString
++
;
}
}
while
(
slot
<
INDEX_MAX_KEYS
)
result
[
slot
++
]
=
0
;
return
result
;
return
result
;
}
}
...
@@ -73,9 +70,9 @@ oid8out(Oid *oidArray)
...
@@ -73,9 +70,9 @@ oid8out(Oid *oidArray)
}
}
/* assumes sign, 10 digits, ' ' */
/* assumes sign, 10 digits, ' ' */
rp
=
result
=
(
char
*
)
palloc
(
8
*
12
);
rp
=
result
=
(
char
*
)
palloc
(
INDEX_MAX_KEYS
*
12
);
sp
=
oidArray
;
sp
=
oidArray
;
for
(
num
=
8
;
num
!=
0
;
num
--
)
for
(
num
=
INDEX_MAX_KEYS
;
num
!=
0
;
num
--
)
{
{
ltoa
(
*
sp
++
,
rp
);
ltoa
(
*
sp
++
,
rp
);
while
(
*++
rp
!=
'\0'
)
while
(
*++
rp
!=
'\0'
)
...
@@ -121,13 +118,13 @@ oidne(Oid arg1, Oid arg2)
...
@@ -121,13 +118,13 @@ oidne(Oid arg1, Oid arg2)
bool
bool
oid8eq
(
Oid
*
arg1
,
Oid
*
arg2
)
oid8eq
(
Oid
*
arg1
,
Oid
*
arg2
)
{
{
return
(
bool
)
(
memcmp
(
arg1
,
arg2
,
8
*
sizeof
(
Oid
))
==
0
);
return
(
bool
)
(
memcmp
(
arg1
,
arg2
,
INDEX_MAX_KEYS
*
sizeof
(
Oid
))
==
0
);
}
}
bool
bool
oid8ne
(
Oid
*
arg1
,
Oid
*
arg2
)
oid8ne
(
Oid
*
arg1
,
Oid
*
arg2
)
{
{
return
(
bool
)
(
memcmp
(
arg1
,
arg2
,
8
*
sizeof
(
Oid
))
!=
0
);
return
(
bool
)
(
memcmp
(
arg1
,
arg2
,
INDEX_MAX_KEYS
*
sizeof
(
Oid
))
!=
0
);
}
}
bool
bool
...
@@ -135,7 +132,7 @@ oid8lt(Oid *arg1, Oid *arg2)
...
@@ -135,7 +132,7 @@ oid8lt(Oid *arg1, Oid *arg2)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
8
;
i
++
)
for
(
i
=
0
;
i
<
INDEX_MAX_KEYS
;
i
++
)
if
(
!
int4eq
(
arg1
[
i
],
arg2
[
i
]))
if
(
!
int4eq
(
arg1
[
i
],
arg2
[
i
]))
return
int4lt
(
arg1
[
i
],
arg2
[
i
]);
return
int4lt
(
arg1
[
i
],
arg2
[
i
]);
return
false
;
return
false
;
...
@@ -146,7 +143,7 @@ oid8le(Oid *arg1, Oid *arg2)
...
@@ -146,7 +143,7 @@ oid8le(Oid *arg1, Oid *arg2)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
8
;
i
++
)
for
(
i
=
0
;
i
<
INDEX_MAX_KEYS
;
i
++
)
if
(
!
int4eq
(
arg1
[
i
],
arg2
[
i
]))
if
(
!
int4eq
(
arg1
[
i
],
arg2
[
i
]))
return
int4le
(
arg1
[
i
],
arg2
[
i
]);
return
int4le
(
arg1
[
i
],
arg2
[
i
]);
return
true
;
return
true
;
...
@@ -157,7 +154,7 @@ oid8ge(Oid *arg1, Oid *arg2)
...
@@ -157,7 +154,7 @@ oid8ge(Oid *arg1, Oid *arg2)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
8
;
i
++
)
for
(
i
=
0
;
i
<
INDEX_MAX_KEYS
;
i
++
)
if
(
!
int4eq
(
arg1
[
i
],
arg2
[
i
]))
if
(
!
int4eq
(
arg1
[
i
],
arg2
[
i
]))
return
int4ge
(
arg1
[
i
],
arg2
[
i
]);
return
int4ge
(
arg1
[
i
],
arg2
[
i
]);
return
true
;
return
true
;
...
@@ -168,7 +165,7 @@ oid8gt(Oid *arg1, Oid *arg2)
...
@@ -168,7 +165,7 @@ oid8gt(Oid *arg1, Oid *arg2)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
8
;
i
++
)
for
(
i
=
0
;
i
<
INDEX_MAX_KEYS
;
i
++
)
if
(
!
int4eq
(
arg1
[
i
],
arg2
[
i
]))
if
(
!
int4eq
(
arg1
[
i
],
arg2
[
i
]))
return
int4gt
(
arg1
[
i
],
arg2
[
i
]);
return
int4gt
(
arg1
[
i
],
arg2
[
i
]);
return
false
;
return
false
;
...
...
This diff is collapsed.
Click to expand it.
src/include/catalog/pg_index.h
+
1
−
4
View file @
b99f3006
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: pg_index.h,v 1.1
2 1999/05/25 16:13:45
momjian Exp $
* $Id: pg_index.h,v 1.1
3 2000/01/10 04:36:37
momjian Exp $
*
*
* NOTES
* NOTES
* the genbki.sh script reads this file and generates .bki
* the genbki.sh script reads this file and generates .bki
...
@@ -58,9 +58,6 @@ CATALOG(pg_index)
...
@@ -58,9 +58,6 @@ CATALOG(pg_index)
text
indpred
;
/* query plan for partial index predicate */
text
indpred
;
/* query plan for partial index predicate */
}
FormData_pg_index
;
}
FormData_pg_index
;
#define INDEX_MAX_KEYS 8
/* maximum number of keys in an index
* definition */
/* ----------------
/* ----------------
* Form_pg_index corresponds to a pointer to a tuple with
* Form_pg_index corresponds to a pointer to a tuple with
* the format of pg_index relation.
* the format of pg_index relation.
...
...
This diff is collapsed.
Click to expand it.
src/include/postgres.h
+
5
−
3
View file @
b99f3006
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1995, Regents of the University of California
* Copyright (c) 1995, Regents of the University of California
*
*
* $Id: postgres.h,v 1.3
1 1999/12/21 00:06:41 wieck
Exp $
* $Id: postgres.h,v 1.3
2 2000/01/10 04:36:36 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -101,8 +101,10 @@ struct varlena
...
@@ -101,8 +101,10 @@ struct varlena
typedef
struct
varlena
bytea
;
typedef
struct
varlena
bytea
;
typedef
struct
varlena
text
;
typedef
struct
varlena
text
;
typedef
int2
int28
[
8
];
#define INDEX_MAX_KEYS 8
/* maximum number of keys in an index
typedef
Oid
oid8
[
8
];
* definition */
typedef
int2
int28
[
INDEX_MAX_KEYS
];
typedef
Oid
oid8
[
INDEX_MAX_KEYS
];
/*
/*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment