From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
Cc: | Eric Lu <yclu(at)ecompliance(dot)net>, pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: referential constraint bug |
Date: | 2002-03-13 20:31:25 |
Message-ID: | 200203132031.g2DKVPO09024@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Stephan, let me know if you want this considered for inclusion in CVS.
Stephan Szabo wrote:
>
> On Wed, 6 Mar 2002, Eric Lu wrote:
>
> > To whom it may concern:
> >
> > I found a constraint bug on PostgreSQL lastest version (7.2).
>
> Yes, it's still seeing some invalid states of the table. I believe
> the following will fix the case (it was part of a larger patch that
> was rejected, but I think this part is safe -- if not I'm sure someone
> will jump in).
>
> *** pgsql/src/backend/utils/adt/ri_triggers.c.orig Tue Mar 12 23:33:32 2002
> --- pgsql/src/backend/utils/adt/ri_triggers.c Tue Mar 12 23:33:47 2002
> ***************
> *** 208,213 ****
> --- 208,224 ----
> new_row = trigdata->tg_trigtuple;
> }
>
> + /*
> + * We should not even consider checking the row if it is no longer
> + * valid since it was either deleted (doesn't matter) or updated
> + * (in which case it'll be checked with its final values).
> + */
> + if (new_row) {
> + if (!HeapTupleSatisfiesItself(new_row->t_data)) {
> + return PointerGetDatum(NULL);
> + }
> + }
> +
> /* ----------
> * SQL3 11.9 <referential constraint definition>
> * Gereral rules 2) a):
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Mikheev, Vadim | 2002-03-13 21:03:44 | Re: Bug #613: Sequence values fall back to previously chec |
Previous Message | Per Winkvist | 2002-03-13 20:10:03 | Case sensitive table names ? |