Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

django insert or update foreign key Key (id)=(100) is not present in table "msg".? #79

Closed
@mapleflow

Description

Env:

Ubuntu 14.04, Django 1.10.5, pg_pathman 1.3, postgresql 9.6

table product reference table msg

alter table product add constraint 
product_msg_fk
foreign key(msg_id) 
references msg(id) 
deferrable initially deferred;

msg works well when directly insert,but when i insert into product record, error occur

django.db.utils.IntegrityError: insert or update on table "product" violates 
foreign key constraint "product_msg_fk" 
DETAIL: Key (msg_id)=(100) is not present in table "msg".

all data are exists in correct partition, i create partition by table msg field create_time.

Anything wrong with my sql, django project or pg_pathman config?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /