Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
ac06a7a2
Commit
ac06a7a2
authored
Nov 30, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to make genbki.sh a little more bulletproof, per trouble report
from Paul Stavrides.
parent
c31bcbc8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
src/backend/catalog/genbki.sh
src/backend/catalog/genbki.sh
+24
-7
No files found.
src/backend/catalog/genbki.sh
View file @
ac06a7a2
...
...
@@ -10,12 +10,12 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh,v 1.2
4 2001/09/08 15:24:00 petere
Exp $
# $Header: /cvsroot/pgsql/src/backend/catalog/Attic/genbki.sh,v 1.2
5 2001/11/30 20:21:06 tgl
Exp $
#
# NOTES
# non-essential whitespace is removed from the generated file.
# if this is ever a problem, then the sed script at the very
# end can be changed into another awk script or something smarter.
.
# end can be changed into another awk script or something smarter.
#
#-------------------------------------------------------------------------
...
...
@@ -121,7 +121,7 @@ trap "rm -f $TMPFILE ${OUTPUT_PREFIX}.bki.$$ ${OUTPUT_PREFIX}.description.$$" 0
# Get NAMEDATALEN from postgres_ext.h
for
dir
in
$INCLUDE_DIRS
;
do
if
[
-f
"
$dir
/postgres_ext.h"
]
;
then
NAMEDATALEN
=
`
grep
'#define[ ]*NAMEDATALEN'
$dir
/postgres_ext.h |
$AWK
'{ print $3 }'
`
NAMEDATALEN
=
`
grep
'
^
#define[ ]*NAMEDATALEN'
$dir
/postgres_ext.h |
$AWK
'{ print $3 }'
`
break
fi
done
...
...
@@ -130,8 +130,8 @@ done
# (who needs consistency?)
for
dir
in
$INCLUDE_DIRS
;
do
if
[
-f
"
$dir
/pg_config.h"
]
;
then
INDEXMAXKEYS
=
`
grep
'#define[ ]*INDEX_MAX_KEYS'
$dir
/pg_config.h |
$AWK
'{ print $3 }'
`
DEFAULTATTSTATTARGET
=
`
grep
'#define[ ]*DEFAULT_ATTSTATTARGET'
$dir
/pg_config.h |
$AWK
'{ print $3 }'
`
INDEXMAXKEYS
=
`
grep
'
^
#define[ ]*INDEX_MAX_KEYS'
$dir
/pg_config.h |
$AWK
'{ print $3 }'
`
DEFAULTATTSTATTARGET
=
`
grep
'
^
#define[ ]*DEFAULT_ATTSTATTARGET'
$dir
/pg_config.h |
$AWK
'{ print $3 }'
`
break
fi
done
...
...
@@ -139,7 +139,7 @@ done
# Get FirstGenBKIObjectId from access/transam.h
for
dir
in
$INCLUDE_DIRS
;
do
if
[
-f
"
$dir
/access/transam.h"
]
;
then
BKIOBJECTID
=
`
grep
'#define[ ]*FirstGenBKIObjectId'
$dir
/access/transam.h |
$AWK
'{ print $3 }'
`
BKIOBJECTID
=
`
grep
'
^
#define[ ]*FirstGenBKIObjectId'
$dir
/access/transam.h |
$AWK
'{ print $3 }'
`
break
fi
done
...
...
@@ -372,7 +372,7 @@ inside == 1 {
# ----
# if we are inside the catalog definition, then keep sucking up
# attibute names and types
# att
r
ibute names and types
# ----
if ($2 ~ /\[.*\]/) { # array attribute
idlen = index($2,"[") - 1;
...
...
@@ -401,6 +401,23 @@ $CPP $BKIOPTS $TMPFILE | \
sed
-e
'/^[ ]*$/d'
\
-e
's/[ ][ ]*/ /g'
>>
${
OUTPUT_PREFIX
}
.bki.
$$
||
exit
#
# Sanity check: if one of the sed/awk/etc commands fails, we'll probably
# end up with a .bki file that is empty or just a few lines. Cross-check
# that the files are of reasonable size. The numbers here are arbitrary,
# but are much smaller than the actual expected sizes as of Postgres 7.2.
#
if
[
`
wc
-c
<
${
OUTPUT_PREFIX
}
.bki.
$$
`
-lt
100000
]
;
then
echo
"
$CMDNAME
: something seems to be wrong with the .bki file"
>
&2
exit
1
fi
if
[
`
wc
-c
<
${
OUTPUT_PREFIX
}
.description.
$$
`
-lt
10000
]
;
then
echo
"
$CMDNAME
: something seems to be wrong with the .description file"
>
&2
exit
1
fi
# Looks good, commit ...
mv
${
OUTPUT_PREFIX
}
.bki.
$$
${
OUTPUT_PREFIX
}
.bki
||
exit
mv
${
OUTPUT_PREFIX
}
.description.
$$
${
OUTPUT_PREFIX
}
.description
||
exit
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment