1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-08 06:02:22 +03:00

findoidjoins is updated for schemas, does not use libpgeasy.

From Joe Conway.
This commit is contained in:
Tom Lane
2002-09-05 19:57:32 +00:00
parent 5b69f695ac
commit d7e654ff79
4 changed files with 216 additions and 171 deletions

View File

@@ -26,7 +26,7 @@ fi
cat /tmp/$$ | while read LINE
do
set -- $LINE
grep "$2" /tmp/$$a >/dev/null 2>&1 || echo $LINE
grep "^$2\$" /tmp/$$a >/dev/null 2>&1 || echo $LINE
done >/tmp/$$b
# Generate the output.
@@ -41,13 +41,12 @@ $AWK -F'[ \.]' '\
}
{
printf "\
SELECT ctid, %s.%s \n\
FROM %s \n\
WHERE %s.%s != 0 AND \n\
NOT EXISTS(SELECT * FROM %s AS t1 WHERE t1.oid = %s.%s);\n",
$2, $3, $2,
$2, $3,
$5, $2, $3;
SELECT ctid, %s \n\
FROM %s.%s fk \n\
WHERE %s != 0 AND \n\
NOT EXISTS(SELECT 1 FROM %s.%s pk WHERE pk.oid = fk.%s);\n",
$4, $2, $3, $4,
$6, $7, $4;
}'
exit 0