Skip to content

Conversation

jrjsmrtn
Copy link
Contributor

A psql -d Adventureworks < install.sql was failing with:

│ Copying data into Sales.SpecialOfferProduct │ └─────────────────────────────────────────────┘ SpecialOfferProduct.csv: No such file or directory │ Copying data into Sales.Store │ └───────────────────────────────┘ ERROR: insert or update on table "salesorderdetail" violates foreign key constraint "FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID" DETAIL: Key (specialofferid, productid)=(1, 776) is not present in table "specialofferproduct". 

The corresponding file path in install.sql was only missing the ./data/ subdirectory prefix:

\copy Sales.SpecialOfferProduct FROM 'SpecialOfferProduct.csv' DELIMITER E'\t' CSV; 

instead of:

\copy Sales.SpecialOfferProduct FROM './data/SpecialOfferProduct.csv' DELIMITER E'\t' CSV; 
@morenoh149
Copy link
Owner

Thanks so much! yeah I was looking into this yesterday.

@morenoh149 morenoh149 merged commit 7149de0 into morenoh149:master Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants