Re: Backpatch FK changes to 7.3 and 7.2?

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Michael Paesold <mpaesold(at)gmx(dot)at>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, chriskl(at)familyhealth(dot)com(dot)au, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Backpatch FK changes to 7.3 and 7.2?
Date: 2003-04-15 17:58:01
Message-ID: 3E9C4829.B7171F7D@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Michael Paesold wrote:
>
> Bruce Momjian wrote:
> >
> > Seems like a small reasonable patch to me, and several folks want it.
> >
>
> I am bit worried with this regression issue. I posted this about a week ago
> but didn't get any response. Anyone else tested this? I re-run the test on a
> fresh download of 7.3.2. Same. Jan, you mentioned something concerning an
> error messages - is this issue causing the regression error?

I replied on Saturday to your question explaining that that change was
expected. You might consider telling those GMX idiots to think again
about their spam filters.

Jan

>
> This is the message I posted before:
>
> I applied the patch to a 7.3.2 installation, and did a make clean, make,
> make check. There is one regression error. Is this an expected behaviour? Or
> did I do something wrong? See regression diffs:
>
> *** ./expected/foreign_key.out Sun Sep 22 02:37:09 2002
> --- ./results/foreign_key.out Sat Apr 12 20:44:54 2003
> ***************
> *** 882,888 ****
> ERROR: $1 referential integrity violation - key in pktable still
> referenced from pktable
> -- fails (1,1) is being referenced (twice)
> update pktable set base1=3 where base1=1;
> ! ERROR: $1 referential integrity violation - key referenced from pktable
> not found in pktable
> -- this sequence of two deletes will work, since after the first there
> will be no (2,*) references
> delete from pktable where base2=2;
> delete from pktable where base1=2;
> --- 882,888 ----
> ERROR: $1 referential integrity violation - key in pktable still
> referenced from pktable
> -- fails (1,1) is being referenced (twice)
> update pktable set base1=3 where base1=1;
> ! ERROR: $1 referential integrity violation - key in pktable still
> referenced from pktable
> -- this sequence of two deletes will work, since after the first there
> will be no (2,*) references
> delete from pktable where base2=2;
> delete from pktable where base1=2;
>
> Regards,
> Michael Paesold
>
> > --------------------------------------------------------------------------
> -
> >
> > Jan Wieck wrote:
> > > Stephan Szabo wrote:
> > > >
> > > > On Tue, 8 Apr 2003, Tatsuo Ishii wrote:
> > > >
> > > > > > > The changes I committed to address most of the FK deadlock
> problems
> > > > > > > reported can easily be applied to the 7.3 and 7.2 source trees
> as well.
> > > > > > >
> > > > > > > Except for a slight change in the text of the error message that
> gets
> > > > > > > thrown "if one tries to delete a referenced PK for which a FK
> with ON
> > > > > > > DELETE SET DEFAULT exists" (it's a rare case, believe me), this
> patch
> > > > > > > would qualify for backpatching. The unnecessary FOR UPDATE lock
> of
> > > > > > > referenced rows could be counted as a bug.
> > > > > > >
> > > > > > > Opinions?
> > > > > >
> > > > > > Since I seem to suffer from these horrible deadlock problems all
> the
> > > > > > time, I'd like it to be backported to 7.3...
> > > > >
> > > > > Me too!
> > > >
> > > > As a note, this'll solve some of the deadlocks on fk update (generally
> the
> > > > key values aren't touched) but not insert related ones (two rows
> inserted
> > > > to the same primary key causing one to wait and possible deadlocks)
> > > >
> > > > In any case, why don't we get a patch against 7.3, and make an
> > > > announcement and let people who are interested use it and test it.
> With
> > > > in-field testing it'd probably be safe enough. :)
> > >
> > > Here it is.
> > >
> > >
> > > 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 #
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html

--
#======================================================================#
# 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 #

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guy Fraser 2003-04-15 18:03:13 Re: Case sensitive order by
Previous Message mallah 2003-04-15 17:45:01 Re: How to change data type in column ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Guy Fraser 2003-04-15 18:23:28 Re: Upgrade to Red Hat Linux 9 broke PostgreSQL
Previous Message Zeugswetter Andreas SB SD 2003-04-15 17:44:37 Re: [GENERAL] Problem about pgsql's column alias