I'm trying to import some data on a table representing rentals of a video club(It's for a school project.) the table is represented as this : rental(RENTAL_ID,CUSTOMER_ID,DATE_OF_RENTAL,DATE_OF_RETURN,FILM_ID), with rental_id being the pk and customer_id and film_id being the fk of other tables(I already imported the data in them).However,when I try to import the data on the rental table,I get this error : ERROR: insert or update on table "rental" violates foreign key constraint "rental_customer_id_fkey" SQL state: 23503 Detail: Key (customer_id)=(524) is not present in table "customer".'' I checked the customer table and it doesnt have a value of 524 for the customer ID. What should I do? Note that I declared all rental_id,customer_id and film_id as serial. Could This be the problem? What should I do?
https://stackoverflow.com/questions/65545999/cant-import-data January 03, 2021 at 10:04AM
没有评论:
发表评论