Splash screen & table rebuilding
Splash screen & table rebuilding
От:
Jean-Michel POURE <jm.poure@freesurf.fr>
Дата:
Hello Dave and all,
I removed elephant pictures and uploaded a new splash screen proposal to CVS.
Could you (please) explain again the guidelines for table rebuilding:
1) Table rebuilding is performed in frmTable.
2) lvProperties(0).Tag = "M" means columns have been modified.
Same as modified checks, modified foreign keys, etc...
3) If any Tag='M', then position bModify = true, rebuilding is necessary.
4) Write a single transaction to perform changes:
a) rename table to a unique name, example '20010927_101215',
b) disable triggers (do you know how to remove rules?),
c) drop indexes, sequences,
d) create table as ....
e) recreate trigger, indexes, update sequence value,
f) drop old table.
5) If for any reason table rebuilding does not work, transaction is rolled
back.
Does it make sense?
Cheers, Jean-Michel
Re: Splash screen & table rebuilding
От:
Dave Page <dpage@vale-housing.co.uk>
Дата:
> -----Original Message----- > From: Jean-Michel POURE [mailto:jm.poure@freesurf.fr] > Sent: 29 September 2001 16:54 > To: pgadmin-hackers@postgresql.org > Subject: [pgadmin-hackers] Splash screen & table rebuilding > > > Hello Dave and all, > > I removed elephant pictures and uploaded a new splash screen > proposal to CVS. Cool, I'll take a look. > Could you (please) explain again the guidelines for table rebuilding: > 1) Table rebuilding is performed in frmTable. Sort of. frmTable with actually just need to do svr.Databases(ctx.CurrentDB).Tables(objTable.Identifier).Columns.Remove($COL NAME) pgSchema will do all of #4 below. > 2) lvProperties(0).Tag = "M" means columns have been modified. > Same as modified checks, modified foreign keys, etc... Um, sounds about right - have I used M though? > 3) If any Tag='M', then position bModify = true, rebuilding > is necessary. Nope. bModify is *always* true unless creating a new table. Basically it just indicates that we're modifying a table rather than creating. It doesn't indicate if we have actually changed anything. > 4) Write a single transaction to perform changes: > a) rename table to a unique name, example '20010927_101215', Yes. > b) disable triggers (do you know how to remove rules?), I assume rules are removed by dropping the relevant row from pg_rewrite. The user would need pg_shadow.usecatupd = True to do this though. > c) drop indexes, sequences, Not sequences. Indexes, Rules, Triggers. Dependant functions & Views will also need rebuilding (though that is the case for many other mods as well so I wouldn't worry about that). > d) create table as .... Yes. D1) Move *all* sub object comments (and invalidate pgSchema's cache). > e) recreate trigger, indexes, update sequence value, Don't worry about the sequences. > f) drop old table. Yup. > 5) If for any reason table rebuilding does not work, > transaction is rolled > back. Sounds about right. It's a lot of work though! BTW: I reserve the right to have forgotten something above!! Regards, Dave.
Re: Splash screen & table rebuilding
От:
Jean-Michel POURE <jm.poure@freesurf.fr>
Дата:
>svr.Databases(ctx.CurrentDB).Tables(objTable.Identifier).Columns.Remove($COL >NAME) Why can't it be svr.Databases(ctx.CurrentDB).Tables(objTable.Identifier).Modify?
Re: Splash screen & table rebuilding
От:
Jean-Michel POURE <jm.poure@freesurf.fr>
Дата:
At 14:12 30/09/01 +0200, you wrote: >>svr.Databases(ctx.CurrentDB).Tables(objTable.Identifier).Columns.Remove($COL >>NAME) Why can't it be svr.Databases(ctx.CurrentDB).Tables(objTable.Identifier, blablabla).Modify? We might need to add and remove rules, foreign keys, etc...