Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: BUG #3417: Foreign key constraint violation occurs unexpectedly




"David Boesch" <davidboesch(at)datasc(dot)com(dot)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




Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group