1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-31 22:04:40 +03:00

Add new make_oidjoin_check utility and template1_check.sql. Fix some

pg_operator problems.
This commit is contained in:
Bruce Momjian
1998-09-14 01:14:49 +00:00
parent f1bcb171e8
commit 3700981108
6 changed files with 223 additions and 7 deletions

View File

@ -0,0 +1,35 @@
:
# You first run findoidjoins on the template1 database, and send that
# output into this file to generate a list of SQL statements.
trap "rm -f /tmp/$$ /tmp/$$a /tmp/$$b" 0 1 2 3 15
cat "$@" >/tmp/$$
cat /tmp/$$ | cut -d' ' -f2 | sort | uniq -d >/tmp/$$a
cat /tmp/$$ | while read LINE
do
set -- $LINE
grep "$2" /tmp/$$a >/dev/null 2>&1 || echo $LINE
done >/tmp/$$b
cat /tmp/$$b |
awk -F'[ \.]' '\
BEGIN \
{
printf "\
--\n\
-- This is created by pgsql/contrib/findoidjoins/make_oidjoin_check\n\
--\n";
}
{
printf "\
SELECT oid, %s.%s \n\
FROM %s \n\
WHERE %s%s.%s%s NOT IN (SELECT oid FROM %s) AND \n\
%s%s.%s%s != 0;\n", $2, $3, $2,
($5 == "pg_proc") ? "RegprocToOid(" : "",
$2, $3,
($5 == "pg_proc") ? ")" : "",
$5,
($5 == "pg_proc") ? "RegprocToOid(" : "",
$2, $3,
($5 == "pg_proc") ? ")" : "";
}'