postgres/contrib/adddepend
Bruce Momjian aa4c702eac Update /contrib for "autocommit TO 'on'".
Create objects in public schema.

Make spacing/capitalization consistent.

Remove transaction block use for object creation.

Remove unneeded function GRANTs.
2002-10-18 18:41:22 +00:00
..
README.adddepend Add 'adddepend' script to handle pre-7.3 object dependencies. 2002-09-18 20:38:59 +00:00
adddepend Update /contrib for "autocommit TO 'on'". 2002-10-18 18:41:22 +00:00

README.adddepend

            Dependency Additions For PostgreSQL 7.3 Upgrades

In PostgreSQL releases prior to 7.3, certain database objects didn't
have proper dependencies.  For example:

1) When you created a table with a SERIAL column, there was no linkage
to its underlying sequence.  If you dropped the table with the SERIAL
column, the sequence was not automatically dropped.  

2) When you created a foreign key, it created three triggers.  If you
wanted to drop the foreign key, you had to drop the three triggers
individually.

3) When you created a column with constraint UNIQUE, a unique index was
created but there was no indication that the index was created as a
UNIQUE column constraint.

Fortunately, 7.3 now tracks such dependencies and handles these cases. 
Unfortunately, PostgreSQL dumps from prior releases don't contain
such dependency information.

This script operates on >= 7.3 databases and adds dependency information
for the objects listed above.  It prompts the user on whether to create
a linkage for each object.  You can use the -Y option to prevent such
prompting and have it generate all possible linkages.

This program requires the Pg:DBD Perl interface.

Usage:

  upgrade.pl [options] [dbname [username]]

Options:
  -d <dbname>     Specify database name to connect to (default: postgres)
  -h <host>       Specify database server host (default: localhost)
  -p <port>       Specify database server port (default: 5432)
  -u <username>   Specify database username (default: postgres)
  --password=<pw> Specify database password (default: blank)

  -Y              The script normally asks whether the user wishes to apply 
                  the conversion for each item found.  This forces YES to all
                  questions.

Rod Taylor <rbt@rbt.ca>