Re: BUG #3417: Foreign key constraint violation occurs unexpectedly - Mailing list pgsql-bugs

From Gregory Stark
Subject Re: BUG #3417: Foreign key constraint violation occurs unexpectedly
Date
Msg-id 87ejjwgs7r.fsf@oxford.xeocode.com
Whole thread Raw
In response to BUG #3417: Foreign key constraint violation occurs unexpectedly  ("David Boesch" <davidboesch@datasc.com.au>)
Responses Re: BUG #3417: Foreign key constraint violation occurs unexpectedly  (David Boesch <davidboesch@datasc.com.au>)
List pgsql-bugs
"David Boesch" <davidboesch@datasc.com.au> writes:

> I add data to reference
>
> select * from reference shows as
>
>  id |      name      |          description
> ----+----------------+--------------------------------
>  11 | rd             | road
>  12 | st             | street
>  13 | way            | way
>  14 | close          | close
>  15 | bend           | bend
>   3 | vic            | victoria
>   4 | nsw            | new south wales
>   5 | qld            | queensland
>   6 | nt             | northern territory
>   7 | sa             | south australia

How did you add this data? Given that the ids are out of order I assume you've
updated or deleted and re-inserted records a few times? That shouldn't break
anything but it's possible the insert on table a doesn't see the same version
of this table that you're looking at with the select.

Also, just to check that there's nothing wrong with the inex, what do you get
if you do:

enable_seqscan = off;
select * from reference where id = 7;

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

pgsql-bugs by date:

Previous
From: "David Boesch"
Date:
Subject: BUG #3417: Foreign key constraint violation occurs unexpectedly
Next
From: Tom Lane
Date:
Subject: Re: BUG #3415: plperl spi_exec_prepared variable undef value confusion