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
a171fc1a
Commit
a171fc1a
authored
20 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Use temp files in current directory, not /tmp, to reduce security risk
while running this script.
parent
fb22b320
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/findoidjoins/make_oidjoins_check
+14
-9
14 additions, 9 deletions
contrib/findoidjoins/make_oidjoins_check
with
14 additions
and
9 deletions
contrib/findoidjoins/make_oidjoins_check
+
14
−
9
View file @
a171fc1a
...
@@ -10,27 +10,32 @@
...
@@ -10,27 +10,32 @@
# Caution: you may need to use GNU awk.
# Caution: you may need to use GNU awk.
AWK
=
${
AWK
:-
awk
}
AWK
=
${
AWK
:-
awk
}
trap
"rm -f /tmp/
$$
/tmp/
$$
a /tmp/
$$
b"
0 1 2 3 15
INPUTFILE
=
"tmp
$$
a"
DUPSFILE
=
"tmp
$$
b"
NONDUPSFILE
=
"tmp
$$
c"
rm
-f
$INPUTFILE
$DUPSFILE
$NONDUPSFILE
trap
"rm -f
$INPUTFILE
$DUPSFILE
$NONDUPSFILE
"
0 1 2 3 15
# Read input
# Read input
cat
"
$@
"
>
/tmp/
$$
cat
"
$@
"
>
$INPUTFILE
# Look for fields with multiple references.
# Look for fields with multiple references.
cat
/tmp/
$$
|
cut
-d
' '
-f2
|
sort
|
uniq
-d
>
/tmp/
$$
a
cat
$INPUTFILE
|
cut
-d
' '
-f2
|
sort
|
uniq
-d
>
$DUPSFILE
if
[
-s
/tmp/
$$
a
]
;
then
if
[
-s
$DUPSFILE
]
;
then
echo
"Ignoring these fields that link to multiple tables:"
1>&2
echo
"Ignoring these fields that link to multiple tables:"
1>&2
cat
/tmp/
$$
a
1>&2
cat
$DUPSFILE
1>&2
fi
fi
# Get the non-multiply-referenced fields.
# Get the non-multiply-referenced fields.
cat
/tmp/
$$
|
while
read
LINE
cat
$INPUTFILE
|
while
read
LINE
do
do
set
--
$LINE
set
--
$LINE
grep
"^
$2
\$
"
/tmp/
$$
a
>
/dev/null 2>&1
||
echo
$LINE
grep
"^
$2
\$
"
$DUPSFILE
>
/dev/null 2>&1
||
echo
$LINE
done
>
/tmp/
$$
b
done
>
$NONDUPSFILE
# Generate the output.
# Generate the output.
cat
/tmp/
$$
b
|
cat
$NONDUPSFILE
|
$AWK
-F
'[ \.]'
'\
$AWK
-F
'[ \.]'
'\
BEGIN \
BEGIN \
{
{
...
...
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