head	1.3;
access;
symbols
	REL9_0_0:1.3
	REL9_1_ALPHA1:1.3
	REL9_0_RC1:1.3
	REL9_0_BETA4:1.3
	REL9_0_STABLE:1.3.0.14
	REL9_0_BETA3:1.3
	REL9_0_BETA2:1.3
	REL8_1_21:1.1
	REL8_2_17:1.2
	REL8_3_11:1.2
	REL8_4_4:1.3
	REL9_0_BETA1:1.3
	REL9_0_ALPHA5_BRANCH:1.3.0.12
	REL9_0_ALPHA5:1.3
	REL8_1_20:1.1
	REL8_2_16:1.2
	REL8_3_10:1.2
	REL8_4_3:1.3
	REL9_0_ALPHA4:1.3
	REL9_0_ALPHA4_BRANCH:1.3.0.10
	REL8_5_ALPHA3:1.3
	REL8_5_ALPHA3_BRANCH:1.3.0.8
	REL8_1_19:1.1
	REL8_2_15:1.2
	REL8_3_9:1.2
	REL8_4_2:1.3
	REL8_5_ALPHA2:1.3
	REL8_5_ALPHA2_BRANCH:1.3.0.6
	REL8_1_18:1.1
	REL8_2_14:1.2
	REL8_3_8:1.2
	REL8_4_1:1.3
	REL8_5_ALPHA1:1.3
	REL8_5_ALPHA1_BRANCH:1.3.0.4
	REL8_4_STABLE:1.3.0.2
	REL8_4_0:1.3
	REL8_4_RC2:1.3
	REL8_4_RC1:1.3
	REL8_4_BETA2:1.3
	REL8_4_BETA1:1.3
	REL8_1_17:1.1
	REL8_2_13:1.2
	REL8_3_7:1.2
	REL8_1_16:1.1
	REL8_2_12:1.2
	REL8_3_6:1.2
	REL8_1_15:1.1
	REL8_2_11:1.2
	REL8_3_5:1.2
	REL8_1_14:1.1
	REL8_2_10:1.2
	REL8_3_4:1.2
	REL8_1_13:1.1
	REL8_2_9:1.2
	REL8_3_3:1.2
	REL8_1_12:1.1
	REL8_2_8:1.2
	REL8_3_2:1.2
	REL8_2_7:1.2
	REL8_3_1:1.2
	REL8_3_STABLE:1.2.0.4
	REL8_3_0:1.2
	REL8_3_RC2:1.2
	REL8_1_11:1.1
	REL8_2_6:1.2
	REL8_3_RC1:1.2
	REL8_3_BETA4:1.2
	REL8_3_BETA3:1.2
	REL8_3_BETA2:1.2
	REL8_3_BETA1:1.2
	REL8_1_10:1.1
	REL8_2_5:1.2
	REL8_1_9:1.1
	REL8_2_4:1.2
	REL8_1_8:1.1
	REL8_2_3:1.2
	REL8_1_7:1.1
	REL8_2_2:1.2
	REL8_1_6:1.1
	REL8_2_1:1.2
	REL8_2_STABLE:1.2.0.2
	REL8_2_0:1.2
	REL8_2_RC1:1.2
	REL8_2_BETA3:1.2
	REL8_2_BETA2:1.2
	REL8_1_5:1.1
	REL8_2_BETA1:1.2
	REL8_1_4:1.1
	REL8_1_3:1.1
	REL8_1_2:1.1
	REL8_1_1:1.1
	REL8_1_STABLE:1.1.0.2
	REL8_1_0:1.1
	REL8_1_0RC1:1.1
	REL8_1_0BETA4:1.1
	REL8_1_0BETA3:1.1
	REL8_1_0BETA2:1.1
	REL8_1_0BETA1:1.1;
locks; strict;
comment	@# @;


1.3
date	2008.10.13.12.59.29;	author tgl;	state Exp;
branches;
next	1.2;

1.2
date	2006.03.11.04.38.42;	author momjian;	state Exp;
branches;
next	1.1;

1.1
date	2005.06.23.02.33.28;	author tgl;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Fix bogus comment emitted by make_oidjoins_check, per Greg Stark.
@
text
@#! /bin/sh

# $PostgreSQL: pgsql/src/tools/findoidjoins/make_oidjoins_check,v 1.2 2006/03/11 04:38:42 momjian Exp $

# You first run findoidjoins on the template1 database, and send that
# output into this script to generate a list of SQL statements.

# NOTE: any field that findoidjoins thinks joins to more than one table
# will NOT be checked by the output of this script.  You should be
# suspicious of multiple entries in findoidjoins' output.

# Caution: you may need to use GNU awk.
AWK=${AWK:-awk}

TMP="${TMPDIR:-/tmp}/make_oidjoins_check.$$"
trap "rm -rf $TMP" 0 1 2 3 15

# Create a temporary directory with the proper permissions so no one can
# intercept our temporary files and cause a security breach.
OMASK="`umask`"
umask 077
if ! mkdir $TMP
then	echo "Can't create temporary directory $TMP." 1>&2
	exit 1
fi
umask "$OMASK"
unset OMASK

INPUTFILE="$TMP/a"
DUPSFILE="$TMP/b"
NONDUPSFILE="$TMP/c"

# Read input
cat "$@@" >$INPUTFILE

# Look for fields with multiple references.
cat $INPUTFILE | cut -d' ' -f2 | sort | uniq -d >$DUPSFILE
if [ -s $DUPSFILE ] ; then
	echo "Ignoring these fields that link to multiple tables:" 1>&2
	cat $DUPSFILE 1>&2
fi

# Get the non-multiply-referenced fields.
cat $INPUTFILE | while read LINE
do
	set -- $LINE
	grep "^$2\$" $DUPSFILE >/dev/null 2>&1 || echo $LINE
done >$NONDUPSFILE

# Generate the output.
cat $NONDUPSFILE |
$AWK -F'[ \.]' '\
	BEGIN \
	{
		printf "\
--\n\
-- This is created by pgsql/src/tools/findoidjoins/make_oidjoins_check\n\
--\n";
	}
	{
		printf "\
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
@


1.2
log
@Add CVS tag lines to files that were lacking them.
@
text
@d3 1
a3 1
# $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.314 2006/03/07 02:54:23 momjian Exp $
d57 1
a57 1
-- This is created by pgsql/contrib/findoidjoins/make_oidjoin_check\n\
@


1.1
log
@Move findoidjoins out of contrib and into src/tools, which is a more
logical place for it since it is of no use to users.  Per recent
discussions on cleaning up contrib.
@
text
@d3 2
@

