logo       

pg_depend patch: msg#00017

Subject: pg_depend patch
Creation of:
src/backend/catalog/pg_constraint.c
src/backend/catalog/pg_depend.c
src/include/catalog/pg_constraint.h
src/include/catalog/pg_depend.h
src/test/regress/expected/drop.out

Removed src/backend/catalog/pg_relcheck.h


TODO list attached which has a list of what I've done.  Additional notes
are below.


Postgresql TODOs completed with this patch:

- Add pg_depend table for dependency recording (slightly different
structure)
- Auto-destroy sequence on DROP of table with SERIAL
- Prevent column (relation) dropping if column is used by foreign key
- Make foreign keys easier to identify.

Worth mentioning:
- Prevent dropping system required functions and types.
- Move all constraints under a single namespace (unique to the relation)


pg_dump can be easily modified to pick up the new foreign key
structure.  There is NOT a mechanism to convert trigger style foreign
keys into constraint entries.

Renaming SERIAL sequences to include the OID would be useful and simple.

Function contents, view contents, and default values can depend on
objects.  Currently not tracked.  One needs to parse their node tree for
all types, functions, relations, columns, and other references recording
these in the pg_depend table.  Patch is still quite useful for other
reasons though :)


Regression tests will fail due to the OIDs used to name constraints
being different with each run.   Suggested solution is to disable NOTICE
during regression tests.  See 'Regression tests and NOTICE statements'
on hackers.

ALTER TABLE DROP CONSTRAINT is still not completely functional (same
state as before).

Documentation updates will follow.  They'll consist primarily of
describing RESTRICT and CASCADE keywords.


NOTE: REINDEX may do strange things.  It appears to be functional, but
has a special hook through dependencies so it won't complain too loudly.
Basically ignores restrictions and doesn't cascade beyond implicit
drops.


Enjoy!

--
Rod

Attachment: depend.patch
Description: Text document

Attachment: pg_depend.c
Description: Text Data

Attachment: pg_constraint.c
Description: Text Data

Attachment: pg_constraint.h
Description: Text Data

Attachment: pg_depend.h
Description: Text Data

Attachment: drop.out
Description: Text document

Attachment: TODO.depend
Description: Text document

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
message can get through to the mailing list cleanly
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe