Re: RI triggers and schemas

From: Jan Wieck <janwieck(at)yahoo(dot)com>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, Jan Wieck <JanWieck(at)yahoo(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: RI triggers and schemas
Date: 2002-04-01 15:25:03
Message-ID: 200204011525.g31FP3J29713@saturn.janwieck.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Christopher Kings-Lynne wrote:
> > I've just realized that if we change the RI trigger arguments this way,
> > we will have a really serious problem with accepting pg_dump scripts
> > from prior versions. The scripts' representation of foreign key
> > constraints will contain commands like
> >
> > CREATE CONSTRAINT TRIGGER "<unnamed>" AFTER UPDATE ON "bar" FROM "baz" NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE PROCEDURE "RI_FKey_noaction_upd" ('<unnamed>', 'baz', 'bar', 'UNSPECIFIED', 'f1', 'f1');
> >
> > which will absolutely not work at all if the 7.3 triggers are expecting
> > to find OIDs in those arguments.
>
> Why can't we just hack up the CREATE CONSTRAINT TRIGGER code to look up
> the OIDs, etc. for the arguments and convert them internally to an ALTER
> TABLE/ADD CONSTRAINT or whatever...

And what language hack do you suggest to suppress the
complete referential check of the foreign key table at ALTER
TABLE ... time? Currently, it does a sequential scan of the
entire table to check every single row. So adding 3
constraints to a 10M row table might take some time.

Note, that that language hack will again make the dump non-
ANSI complient and thus, I don't consider the entire change
to ALTER TABLE an improvement at all.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2002-04-01 15:29:21 Re: RI triggers and schemas
Previous Message Christopher Kings-Lynne 2002-04-01 07:08:30 Re: RI triggers and schemas