Re: simple code cleanups - Mailing list pgsql-patches

From Stephan Szabo
Subject Re: simple code cleanups
Date
Msg-id 20020219180907.X94417-100000@megazone23.bigpanda.com
Whole thread Raw
In response to simple code cleanups  (Neil Conway <nconway@klamath.dyndns.org>)
Responses Re: simple code cleanups
List pgsql-patches
On 19 Feb 2002, Neil Conway wrote:

> I was taking a look at making ALTER TABLE ... RENAME work with
> referential integrity constraints. While doing so, I cleaned up a few
> spots of code along the way (mostly just adding 'const' qualifiers to
> char* params) -- only the change in rename.c is slightly noteworthy.
> Unless anyone sees any problems, please apply for 7.3.
>
> As for the ALTER TABLE ... RENAME stuff, I gave up for the moment --
> next I think I'm going to try changing the referential integrity code to
> use oids rather than relation names, so that should kill 2 birds with
> one stone (since changing RI to use OIDs is also on the TODO list, and
> the OID doesn't change when a relation or attribute is renamed).
> Suggestions/advice are welcome.

You have to be careful about changing the RI constraints to use oids
because you'll need to support restores from systems where the constraint
was dumped with names, so you can't simply make it take oids only.  In
addition, the triggers should probably take attnos for the attributes
rather than names.  I'd been figuring on making new functions that took
oids/attnos and changing dumping so that over time the old functions would
eventually stop being used (such as using alter table to dump the
constraints) and internally have the old functions end up being wrappers
around the new ones.

I'd been planning to start doing a bunch of work on the trigger functions
now that 7.3 development's started.  I was hoping to put together a high
level plan of attack for hackers this week to see what the response was.



pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: simple code cleanups
Next
From: Neil Conway
Date:
Subject: Re: simple code cleanups