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

Re: Splash screen & table rebuilding

From: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
To: "'Jean-Michel POURE'" <jm(dot)poure(at)freesurf(dot)fr>, pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Splash screen & table rebuilding
Date: 2001-09-29 16:37:45
Message-ID: AA30E7BCCA5C1D4E88A231900F8325C00B45@dogbert.vale-housing.co.uk (view raw or flat)
Thread:
Lists: pgadmin-hackers

> -----Original Message-----
> From: Jean-Michel POURE [mailto:jm(dot)poure(at)freesurf(dot)fr] 
> Sent: 29 September 2001 16:54
> To: pgadmin-hackers(at)postgresql(dot)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

Next:From: Jean-Michel POUREDate: 2001-09-30 12:12:30
Subject: Re: Splash screen & table rebuilding
Previous:From: Jean-Michel POUREDate: 2001-09-29 15:53:30
Subject: Splash screen & table rebuilding

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