Re: Referential integrity violation

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Referential integrity violation
Дата
Msg-id 20020313081822.M81426-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на Referential integrity violation  (bombadil@wanadoo.es)
Ответы Re: Referential integrity violation
Список pgsql-general
On Wed, 13 Mar 2002 bombadil@wanadoo.es wrote:

>  Database has more tables (obviously), but I supose it is enought with
>  these.
>
>  When I try next query:
>
>      # update gasto SET importe = round(importe,2);
>
>  I get error:
>
>      ERROR:  <unnamed> referential integrity violation - key
>     referenced from gasto not found in aviso
>
>  I supose this error means that there is a reference in field "aviso"
>  of table "gasto" to inexistent "n�mero" from "aviso" (data was
>  imported with copy from other database).
>
>  If it is so, then inserting data again in table "gasto" with inserts
>  instead of copy sould fix situation, revoking inserts that woldn't
>  comply with referential integrity rules.
>
>  I have do it so:
>
>      pg_dump -a -d -f foo.sql -t gasto database
>
>  and after truncate data:
>
>      psql database -f foo.sql
>
>  Then, when I try my query again, I get same error. Have you any idea
>  of actual problem? Where am I wrong in my asumptions?.

Can you distill an example case with test data (or real data if it's not
something that needs to be secured)?  I see you're using inheritance
in your layout and I know that has some issues if you're referencing to
something that is inherited, but I'm not sure what's going on precisely.


В списке pgsql-general по дате отправления:

Предыдущее
От: Jean-Michel POURE
Дата:
Сообщение: Re: Export a database or a table from a database
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Last Insert