head	1.7;
access;
symbols
	REL9_0_0:1.7
	REL9_1_ALPHA1:1.7
	REL9_0_RC1:1.7
	REL9_0_BETA4:1.7
	REL9_0_STABLE:1.7.0.4
	REL9_0_BETA3:1.7
	REL9_0_BETA2:1.7
	REL8_1_21:1.1
	REL8_2_17:1.1
	REL8_3_11:1.4
	REL8_4_4:1.6
	REL9_0_BETA1:1.7
	REL9_0_ALPHA5_BRANCH:1.7.0.2
	REL9_0_ALPHA5:1.7
	REL8_1_20:1.1
	REL8_2_16:1.1
	REL8_3_10:1.4
	REL8_4_3:1.6
	REL9_0_ALPHA4:1.6
	REL9_0_ALPHA4_BRANCH:1.6.0.10
	REL8_5_ALPHA3:1.6
	REL8_5_ALPHA3_BRANCH:1.6.0.8
	REL8_1_19:1.1
	REL8_2_15:1.1
	REL8_3_9:1.4
	REL8_4_2:1.6
	REL8_5_ALPHA2:1.6
	REL8_5_ALPHA2_BRANCH:1.6.0.6
	REL8_1_18:1.1
	REL8_2_14:1.1
	REL8_3_8:1.4
	REL8_4_1:1.6
	REL8_5_ALPHA1:1.6
	REL8_5_ALPHA1_BRANCH:1.6.0.4
	REL8_4_STABLE:1.6.0.2
	REL8_4_0:1.6
	REL8_4_RC2:1.6
	REL8_4_RC1:1.6
	REL8_4_BETA2:1.6
	REL8_4_BETA1:1.6
	REL8_1_17:1.1
	REL8_2_13:1.1
	REL8_3_7:1.4
	REL8_1_16:1.1
	REL8_2_12:1.1
	REL8_3_6:1.4
	REL8_1_15:1.1
	REL8_2_11:1.1
	REL8_3_5:1.4
	REL8_1_14:1.1
	REL8_2_10:1.1
	REL8_3_4:1.4
	REL8_1_13:1.1
	REL8_2_9:1.1
	REL8_3_3:1.4
	REL8_1_12:1.1
	REL8_2_8:1.1
	REL8_3_2:1.4
	REL8_2_7:1.1
	REL8_3_1:1.4
	REL8_3_STABLE:1.4.0.2
	REL8_3_0:1.4
	REL8_3_RC2:1.4
	REL8_1_11:1.1
	REL8_2_6:1.1
	REL8_3_RC1:1.4
	REL8_3_BETA4:1.4
	REL8_3_BETA3:1.4
	REL8_3_BETA2:1.4
	REL8_3_BETA1:1.4
	REL8_1_10:1.1
	REL8_2_5:1.1
	REL8_1_9:1.1
	REL8_2_4:1.1
	REL8_1_8:1.1
	REL8_2_3:1.1
	REL8_1_7:1.1
	REL8_2_2:1.1
	REL8_1_6:1.1
	REL8_2_1:1.1
	REL8_2_STABLE:1.1.0.4
	REL8_2_0:1.1
	REL8_2_RC1:1.1
	REL8_2_BETA3:1.1
	REL8_2_BETA2:1.1
	REL8_1_5:1.1
	REL8_2_BETA1:1.1
	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.7
date	2010.03.14.04.17.54;	author tgl;	state Exp;
branches;
next	1.6;

1.6
date	2008.10.13.12.59.57;	author tgl;	state Exp;
branches;
next	1.5;

1.5
date	2008.03.21.13.23.29;	author momjian;	state Exp;
branches;
next	1.4;

1.4
date	2007.05.11.17.57.14;	author tgl;	state Exp;
branches;
next	1.3;

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

1.2
date	2006.12.23.00.43.13;	author tgl;	state Exp;
branches;
next	1.1;

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


desc
@@


1.7
log
@Update oidjoins regression test for 9.0.
@
text
@$PostgreSQL: pgsql/src/tools/findoidjoins/README,v 1.6 2008/10/13 12:59:57 tgl Exp $

findoidjoins
============

This program scans a database and prints oid fields (also reg* fields)
and the tables they join to.  We don't really recommend running it on
anything but an empty database, such as template1; else it's likely to
be very slow.

Run on an empty database, it returns the system join relationships (shown
below for 9.0devel).  Note that unexpected matches may indicate bogus entries
in system tables --- don't accept a peculiar match without question.
In particular, a field shown as joining to more than one target table is
probably messed up.  In 9.0devel, the *only* fields that should join to more
than one target are pg_description.objoid, pg_depend.objid,
pg_depend.refobjid, pg_shdescription.objoid, pg_shdepend.objid, and
pg_shdepend.refobjid.  (Running make_oidjoins_check is an easy way to spot
fields joining to more than one table, BTW.)  NOTE: in an empty database,
findoidjoins may not report joins for pg_shdescription and pg_shdepend for
lack of any entries there.

The shell script make_oidjoins_check converts findoidjoins' output
into an SQL script that checks for dangling links (entries in an
OID or REG* column that don't match any row in the expected table).
Note that fields joining to more than one table are NOT processed.

The result of make_oidjoins_check should be installed as the "oidjoins"
regression test.  The oidjoins test should be updated after any
revision in the patterns of cross-links between system tables.
(Ideally we'd just regenerate the script as part of the regression
tests themselves, but that seems too slow...)

NOTE: in 9.0devel, make_oidjoins_check produces two bogus join checks:
Join pg_catalog.pg_class.relfilenode => pg_catalog.pg_class.oid
Join pg_catalog.pg_database.datlastsysoid => pg_catalog.pg_database.oid
These are artifacts and should not be added to the oidjoins regress test.
You might also get output for pg_shdepend.refobjid and pg_shdescription.objoid,
neither of which should be added.

---------------------------------------------------------------------------

Join pg_catalog.pg_aggregate.aggfnoid => pg_catalog.pg_proc.oid
Join pg_catalog.pg_aggregate.aggtransfn => pg_catalog.pg_proc.oid
Join pg_catalog.pg_aggregate.aggfinalfn => pg_catalog.pg_proc.oid
Join pg_catalog.pg_aggregate.aggsortop => pg_catalog.pg_operator.oid
Join pg_catalog.pg_aggregate.aggtranstype => pg_catalog.pg_type.oid
Join pg_catalog.pg_am.amkeytype => pg_catalog.pg_type.oid
Join pg_catalog.pg_am.aminsert => pg_catalog.pg_proc.oid
Join pg_catalog.pg_am.ambeginscan => pg_catalog.pg_proc.oid
Join pg_catalog.pg_am.amgettuple => pg_catalog.pg_proc.oid
Join pg_catalog.pg_am.amgetbitmap => pg_catalog.pg_proc.oid
Join pg_catalog.pg_am.amrescan => pg_catalog.pg_proc.oid
Join pg_catalog.pg_am.amendscan => pg_catalog.pg_proc.oid
Join pg_catalog.pg_am.ammarkpos => pg_catalog.pg_proc.oid
Join pg_catalog.pg_am.amrestrpos => pg_catalog.pg_proc.oid
Join pg_catalog.pg_am.ambuild => pg_catalog.pg_proc.oid
Join pg_catalog.pg_am.ambulkdelete => pg_catalog.pg_proc.oid
Join pg_catalog.pg_am.amvacuumcleanup => pg_catalog.pg_proc.oid
Join pg_catalog.pg_am.amcostestimate => pg_catalog.pg_proc.oid
Join pg_catalog.pg_am.amoptions => pg_catalog.pg_proc.oid
Join pg_catalog.pg_amop.amopfamily => pg_catalog.pg_opfamily.oid
Join pg_catalog.pg_amop.amoplefttype => pg_catalog.pg_type.oid
Join pg_catalog.pg_amop.amoprighttype => pg_catalog.pg_type.oid
Join pg_catalog.pg_amop.amopopr => pg_catalog.pg_operator.oid
Join pg_catalog.pg_amop.amopmethod => pg_catalog.pg_am.oid
Join pg_catalog.pg_amproc.amprocfamily => pg_catalog.pg_opfamily.oid
Join pg_catalog.pg_amproc.amproclefttype => pg_catalog.pg_type.oid
Join pg_catalog.pg_amproc.amprocrighttype => pg_catalog.pg_type.oid
Join pg_catalog.pg_amproc.amproc => pg_catalog.pg_proc.oid
Join pg_catalog.pg_attribute.attrelid => pg_catalog.pg_class.oid
Join pg_catalog.pg_attribute.atttypid => pg_catalog.pg_type.oid
Join pg_catalog.pg_cast.castsource => pg_catalog.pg_type.oid
Join pg_catalog.pg_cast.casttarget => pg_catalog.pg_type.oid
Join pg_catalog.pg_cast.castfunc => pg_catalog.pg_proc.oid
Join pg_catalog.pg_class.relnamespace => pg_catalog.pg_namespace.oid
Join pg_catalog.pg_class.reltype => pg_catalog.pg_type.oid
Join pg_catalog.pg_class.relowner => pg_catalog.pg_authid.oid
Join pg_catalog.pg_class.relam => pg_catalog.pg_am.oid
Join pg_catalog.pg_class.reltablespace => pg_catalog.pg_tablespace.oid
Join pg_catalog.pg_class.reltoastrelid => pg_catalog.pg_class.oid
Join pg_catalog.pg_class.reltoastidxid => pg_catalog.pg_class.oid
Join pg_catalog.pg_constraint.connamespace => pg_catalog.pg_namespace.oid
Join pg_catalog.pg_constraint.contypid => pg_catalog.pg_type.oid
Join pg_catalog.pg_conversion.connamespace => pg_catalog.pg_namespace.oid
Join pg_catalog.pg_conversion.conowner => pg_catalog.pg_authid.oid
Join pg_catalog.pg_conversion.conproc => pg_catalog.pg_proc.oid
Join pg_catalog.pg_database.datdba => pg_catalog.pg_authid.oid
Join pg_catalog.pg_database.dattablespace => pg_catalog.pg_tablespace.oid
Join pg_catalog.pg_db_role_setting.setdatabase => pg_catalog.pg_database.oid
Join pg_catalog.pg_depend.classid => pg_catalog.pg_class.oid
Join pg_catalog.pg_depend.refclassid => pg_catalog.pg_class.oid
Join pg_catalog.pg_description.classoid => pg_catalog.pg_class.oid
Join pg_catalog.pg_index.indexrelid => pg_catalog.pg_class.oid
Join pg_catalog.pg_index.indrelid => pg_catalog.pg_class.oid
Join pg_catalog.pg_language.lanowner => pg_catalog.pg_authid.oid
Join pg_catalog.pg_language.lanplcallfoid => pg_catalog.pg_proc.oid
Join pg_catalog.pg_language.laninline => pg_catalog.pg_proc.oid
Join pg_catalog.pg_language.lanvalidator => pg_catalog.pg_proc.oid
Join pg_catalog.pg_namespace.nspowner => pg_catalog.pg_authid.oid
Join pg_catalog.pg_opclass.opcmethod => pg_catalog.pg_am.oid
Join pg_catalog.pg_opclass.opcnamespace => pg_catalog.pg_namespace.oid
Join pg_catalog.pg_opclass.opcowner => pg_catalog.pg_authid.oid
Join pg_catalog.pg_opclass.opcfamily => pg_catalog.pg_opfamily.oid
Join pg_catalog.pg_opclass.opcintype => pg_catalog.pg_type.oid
Join pg_catalog.pg_opclass.opckeytype => pg_catalog.pg_type.oid
Join pg_catalog.pg_operator.oprnamespace => pg_catalog.pg_namespace.oid
Join pg_catalog.pg_operator.oprowner => pg_catalog.pg_authid.oid
Join pg_catalog.pg_operator.oprleft => pg_catalog.pg_type.oid
Join pg_catalog.pg_operator.oprright => pg_catalog.pg_type.oid
Join pg_catalog.pg_operator.oprresult => pg_catalog.pg_type.oid
Join pg_catalog.pg_operator.oprcom => pg_catalog.pg_operator.oid
Join pg_catalog.pg_operator.oprnegate => pg_catalog.pg_operator.oid
Join pg_catalog.pg_operator.oprcode => pg_catalog.pg_proc.oid
Join pg_catalog.pg_operator.oprrest => pg_catalog.pg_proc.oid
Join pg_catalog.pg_operator.oprjoin => pg_catalog.pg_proc.oid
Join pg_catalog.pg_opfamily.opfmethod => pg_catalog.pg_am.oid
Join pg_catalog.pg_opfamily.opfnamespace => pg_catalog.pg_namespace.oid
Join pg_catalog.pg_opfamily.opfowner => pg_catalog.pg_authid.oid
Join pg_catalog.pg_proc.pronamespace => pg_catalog.pg_namespace.oid
Join pg_catalog.pg_proc.proowner => pg_catalog.pg_authid.oid
Join pg_catalog.pg_proc.prolang => pg_catalog.pg_language.oid
Join pg_catalog.pg_proc.prorettype => pg_catalog.pg_type.oid
Join pg_catalog.pg_rewrite.ev_class => pg_catalog.pg_class.oid
Join pg_catalog.pg_shdepend.refclassid => pg_catalog.pg_class.oid
Join pg_catalog.pg_shdescription.classoid => pg_catalog.pg_class.oid
Join pg_catalog.pg_statistic.starelid => pg_catalog.pg_class.oid
Join pg_catalog.pg_statistic.staop1 => pg_catalog.pg_operator.oid
Join pg_catalog.pg_statistic.staop2 => pg_catalog.pg_operator.oid
Join pg_catalog.pg_statistic.staop3 => pg_catalog.pg_operator.oid
Join pg_catalog.pg_tablespace.spcowner => pg_catalog.pg_authid.oid
Join pg_catalog.pg_ts_config.cfgnamespace => pg_catalog.pg_namespace.oid
Join pg_catalog.pg_ts_config.cfgowner => pg_catalog.pg_authid.oid
Join pg_catalog.pg_ts_config.cfgparser => pg_catalog.pg_ts_parser.oid
Join pg_catalog.pg_ts_config_map.mapcfg => pg_catalog.pg_ts_config.oid
Join pg_catalog.pg_ts_config_map.mapdict => pg_catalog.pg_ts_dict.oid
Join pg_catalog.pg_ts_dict.dictnamespace => pg_catalog.pg_namespace.oid
Join pg_catalog.pg_ts_dict.dictowner => pg_catalog.pg_authid.oid
Join pg_catalog.pg_ts_dict.dicttemplate => pg_catalog.pg_ts_template.oid
Join pg_catalog.pg_ts_parser.prsnamespace => pg_catalog.pg_namespace.oid
Join pg_catalog.pg_ts_parser.prsstart => pg_catalog.pg_proc.oid
Join pg_catalog.pg_ts_parser.prstoken => pg_catalog.pg_proc.oid
Join pg_catalog.pg_ts_parser.prsend => pg_catalog.pg_proc.oid
Join pg_catalog.pg_ts_parser.prsheadline => pg_catalog.pg_proc.oid
Join pg_catalog.pg_ts_parser.prslextype => pg_catalog.pg_proc.oid
Join pg_catalog.pg_ts_template.tmplnamespace => pg_catalog.pg_namespace.oid
Join pg_catalog.pg_ts_template.tmplinit => pg_catalog.pg_proc.oid
Join pg_catalog.pg_ts_template.tmpllexize => pg_catalog.pg_proc.oid
Join pg_catalog.pg_type.typnamespace => pg_catalog.pg_namespace.oid
Join pg_catalog.pg_type.typowner => pg_catalog.pg_authid.oid
Join pg_catalog.pg_type.typrelid => pg_catalog.pg_class.oid
Join pg_catalog.pg_type.typelem => pg_catalog.pg_type.oid
Join pg_catalog.pg_type.typarray => pg_catalog.pg_type.oid
Join pg_catalog.pg_type.typinput => pg_catalog.pg_proc.oid
Join pg_catalog.pg_type.typoutput => pg_catalog.pg_proc.oid
Join pg_catalog.pg_type.typreceive => pg_catalog.pg_proc.oid
Join pg_catalog.pg_type.typsend => pg_catalog.pg_proc.oid
Join pg_catalog.pg_type.typmodin => pg_catalog.pg_proc.oid
Join pg_catalog.pg_type.typmodout => pg_catalog.pg_proc.oid
Join pg_catalog.pg_type.typanalyze => pg_catalog.pg_proc.oid
Join pg_catalog.pg_type.typbasetype => pg_catalog.pg_type.oid

---------------------------------------------------------------------------

Bruce Momjian (root@@candle.pha.pa.us)
Updated for 7.3 by Joe Conway (mail@@joeconway.com)
@


1.6
log
@Update oidjoins test to match CVS HEAD.
@
text
@d1 1
a1 1
$PostgreSQL: pgsql/src/tools/findoidjoins/README,v 1.5 2008/03/21 13:23:29 momjian Exp $
d12 1
a12 1
below for 8.4devel).  Note that unexpected matches may indicate bogus entries
d15 1
a15 1
probably messed up.  In 8.4devel, the *only* fields that should join to more
d34 1
a34 1
NOTE: in 8.4devel, make_oidjoins_check produces two bogus join checks:
d90 1
d97 2
a131 2
Join pg_catalog.pg_trigger.tgrelid => pg_catalog.pg_class.oid
Join pg_catalog.pg_trigger.tgfoid => pg_catalog.pg_proc.oid
@


1.5
log
@More README src cleanups.
@
text
@d1 1
a1 1
$PostgreSQL: pgsql/src/tools/findoidjoins/README,v 1.4 2007/05/11 17:57:14 tgl Exp $
d12 1
a12 1
below for 8.3).  Note that unexpected matches may indicate bogus entries
d15 1
a15 1
probably messed up.  In 8.3, the *only* fields that should join to more
d34 1
a34 1
NOTE: in 8.3, make_oidjoins_check produces two bogus join checks:
d38 2
d48 1
d52 1
a52 1
Join pg_catalog.pg_am.amgetmulti => pg_catalog.pg_proc.oid
d131 17
d159 1
@


1.4
log
@Support arrays of composite types, including the rowtypes of regular tables
and views (but not system catalogs, nor sequences or toast tables).  Get rid
of the hardwired convention that a type's array type is named exactly "_type",
instead using a new column pg_type.typarray to provide the linkage.  (It still
will be named "_type", though, except in odd corner cases such as
maximum-length type names.)

Along the way, make tracking of owner and schema dependencies for types more
uniform: a type directly created by the user has these dependencies, while a
table rowtype or auto-generated array type does not have them, but depends on
its parent object instead.

David Fetter, Andrew Dunstan, Tom Lane
@
text
@d1 1
a1 1
$PostgreSQL$
d3 2
a4 1
   			      findoidjoins
@


1.3
log
@Support type modifiers for user-defined types, and pull most knowledge
about typmod representation for standard types out into type-specific
typmod I/O functions.  Teodor Sigaev, with some editorialization by
Tom Lane.
@
text
@d1 1
d91 1
d131 1
@


1.2
log
@Restructure operator classes to allow improved handling of cross-data-type
cases.  Operator classes now exist within "operator families".  While most
families are equivalent to a single class, related classes can be grouped
into one family to represent the fact that they are semantically compatible.
Cross-type operators are now naturally adjunct parts of a family, without
having to wedge them into a particular opclass as we had done originally.

This commit restructures the catalogs and cleans up enough of the fallout so
that everything still works at least as well as before, but most of the work
needed to actually improve the planner's behavior will come later.  Also,
there are not yet CREATE/DROP/ALTER OPERATOR FAMILY commands; the only way
to create a new family right now is to allow CREATE OPERATOR CLASS to make
one by default.  I owe some more documentation work, too.  But that can all
be done in smaller pieces once this infrastructure is in place.
@
text
@d133 2
@


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
@d10 1
a10 1
below for 8.1).  Note that unexpected matches may indicate bogus entries
d13 7
a19 4
probably messed up.  In 8.1, the *only* fields that should join to more
than one target are pg_description.objoid, pg_depend.objid, and
pg_depend.refobjid.  (Running make_oidjoins_check is an easy way to spot
fields joining to more than one table, BTW.)
d32 1
a32 1
NOTE: in 8.1, make_oidjoins_check produces two bogus join checks:
d56 4
a59 2
Join pg_catalog.pg_amop.amopclaid => pg_catalog.pg_opclass.oid
Join pg_catalog.pg_amop.amopsubtype => pg_catalog.pg_type.oid
d61 4
a64 2
Join pg_catalog.pg_amproc.amopclaid => pg_catalog.pg_opclass.oid
Join pg_catalog.pg_amproc.amprocsubtype => pg_catalog.pg_type.oid
d73 1
d81 1
d83 1
d91 2
a92 1
Join pg_catalog.pg_opclass.opcamid => pg_catalog.pg_am.oid
d94 2
d97 1
d99 1
a104 4
Join pg_catalog.pg_operator.oprlsortop => pg_catalog.pg_operator.oid
Join pg_catalog.pg_operator.oprrsortop => pg_catalog.pg_operator.oid
Join pg_catalog.pg_operator.oprltcmpop => pg_catalog.pg_operator.oid
Join pg_catalog.pg_operator.oprgtcmpop => pg_catalog.pg_operator.oid
d108 3
d112 1
d116 2
d122 1
d126 1
@

