Re: Splash screen & table rebuilding - Mailing list pgadmin-hackers

From Dave Page
Subject Re: Splash screen & table rebuilding
Date
Msg-id AA30E7BCCA5C1D4E88A231900F8325C00B45@dogbert.vale-housing.co.uk
Whole thread Raw
In response to Splash screen & table rebuilding  (Jean-Michel POURE <jm.poure@freesurf.fr>)
List pgadmin-hackers

> -----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.

pgadmin-hackers by date:

Previous
From: Jean-Michel POURE
Date:
Subject: Splash screen & table rebuilding
Next
From: Jean-Michel POURE
Date:
Subject: Re: Splash screen & table rebuilding