Skip site navigation (1) Skip section navigation (2)

Dependency / Constraint patch

From: Rod Taylor <rbt(at)zort(dot)ca>
To: pgsql-patches(at)postgresql(dot)org
Subject: Dependency / Constraint patch
Date: 2002-06-15 19:10:10
Message-ID: 3D0B9112.6010201@zort.ca (view raw or flat)
Thread:
Lists: pgsql-patches
Differences from previous version:
- Fully functional ALTER TABLE / DROP CONSTRAINT
- pg_dump uses ALTER TABLE / ADD FOREIGN KEY
- psql displays foreign keys (\d output)
- Foreign key triggers are autonamed based on the constraint name
- Namespace dependencies were quickly added.  Unable to test them very 
well (DROP SCHEMA required)


Postgresql TODO items completed (or very close):
# Add ALTER TABLE DROP non-CHECK CONSTRAINT
# Allow psql \d to show foreign keys
*  Add pg_depend table for dependency recording; use sysrelid, oid, 
depend_sysrelid, depend_oid, name
# Auto-destroy sequence on DROP of table with SERIAL
# Prevent column dropping if column is used by foreign key
# Automatically drop constraints/functions when object is dropped
# Make constraints clearer in dump file
# Make foreign keys easier to identify



The locking of relations may not be as strong as it should be.  I was 
unable to cause failure -- and can't see what it would be missing but it 
has been bothering me.

I've not touched pg_dump for SERIAL stuff.  I may do it later.

Basic documentation updates included.  I'll scour for examples or notes 
which may no longer apply in a couple of weeks.


Attached files:

TODO.depend - A short list of items I completed, notes, any assumptions, 
and possible outstanding items

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

Remove:
src/backend/catalog/pg_relcheck.c
src/include/catalog/pg_relcheck.h



Attachment: drop.out
Description: text/plain (5.0 KB)
Attachment: pg_depend.h
Description: text/plain (2.8 KB)
Attachment: pg_constraint.h
Description: text/plain (3.8 KB)
Attachment: pg_depend.c
Description: text/plain (19.2 KB)
Attachment: pg_constraint.c
Description: text/plain (17.4 KB)
Attachment: TODO.depend
Description: text/plain (3.5 KB)

Responses

pgsql-patches by date

Next:From: Rod TaylorDate: 2002-06-15 19:13:25
Subject: Re: Dependency / Constraint patch
Previous:From: Bruce MomjianDate: 2002-06-15 18:49:52
Subject: Re: libpq++ fixes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group