Re: simple code cleanups

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: simple code cleanups
Date: 2002-02-20 02:19:22
Message-ID: 20020219180907.X94417-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2002-02-20 02:37:17 Re: simple code cleanups
Previous Message Neil Conway 2002-02-20 01:40:54 simple code cleanups