我开始学习PostgreSQL和pgAdmin4。从台式机读取CSV文件时遇到问题。我浏览了整个网站和这个网站,但找不到答案。我收到此错误:
ERROR: could not open file "C:\Users\Jasmina\Desktop\OnlineRetail2.csv" for reading: Permission denied
SQL state: 42501
我尝试使用/copy
,但仍然无法正常工作。有什么问题,我在做什么错?4
CREATE TABLE Public."My_OnlineRetail"(InvoiceNo int,
StockCode varchar(100),
Description varchar(100),
Quantity int,
InvoiceDate timestamp,
UnitPrice float,
Currency varchar(10),
CustomerID int,
Country varchar(100));
SELECT * FROM Public."My_OnlineRetail";
COPY Public."My_OnlineRetail" FROM 'C:\Users\Jasmina\Desktop\OnlineRetail2.csv' DELIMITER ',' CSV HEADER;