Re: Foreign key modification

From: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
To: "'Jean-Michel POURE'" <jmpoure(at)axitrad(dot)com>, pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Foreign key modification
Date: 2001-09-27 07:59:53
Message-ID: AA30E7BCCA5C1D4E88A231900F8325C00B27@dogbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

> -----Original Message-----
> From: Jean-Michel POURE [mailto:jmpoure(at)axitrad(dot)com]
> Sent: 26 September 2001 14:40
> To: pgadmin-hackers(at)postgresql(dot)org
> Subject: [pgadmin-hackers] Foreign key modification
>
>
> Hello Dave and all,
>
> I really need to modify foreign keys on an existing database.
> As there is no ALTER TABLE DROP command, I need a pseudo
> rebuild feature
> (CREATE TABLE AS).
>
> Could you please explain the guidelines for adding this
> feature to pgAdmin II. Don't worry, I will not upload code
> until it is stable and reviewed by you.

Can't you pick an easier one to start with?!?! Foreign Keys are probably the
most complex bit of pgSchema...

In the simplest terms, pgSchema will need Remove & Add methods in
ForeignKeys.cls. These will drop/re-create the three triggers that make up
the Foreign Key (I assume there is nothing more to an fkey, I've certainly
never found anything).

If you wish to edit an fkey, you will need to make the relevant property of
pgForeignKey.cls read/write and add the code to the Property Let to drop &
recreate the relevant trigger in the required way.

I would take a look at how ForeignKeys.cls analyses the existing triggers to
figure out what the triggers look like and how to best modify them.

Regards, Dave.

Browse pgadmin-hackers by date

  From Date Subject
Next Message Jean-Michel POURE 2001-09-27 08:07:30 Re: Foreign key modification
Previous Message Jean-Michel POURE 2001-09-26 13:40:14 Foreign key modification