Hi im trying to import the yago Database Importer
which is an SQL file into using pgAdmin 4's query tool.
the SQL file look like this I added the path of tsv
files in the SQL file
-- Creating table
DROP TABLE IF EXISTS yagoFacts;
CREATE TABLE yagoFacts (id varchar, subject varchar, predicate varchar, object varchar, value float);
-- Loading files
-- (don't worry if some files are not found)
SET client_encoding to 'utf-8';
copy yagoFacts FROM 'E:/Master/NLP/project/iaprtc12/iaprtc12/Postgres/yagoDateFacts.tsv' NULL AS ''
copy yagoFacts FROM 'E:/Master/NLP/project/iaprtc12/iaprtc12/Postgres/yagoFacts.tsv' NULL AS ''
copy yagoFacts FROM 'E:/Master/NLP/project/iaprtc12/iaprtc12/Postgres/yagoLabels.tsv' NULL AS ''
copy yagoFacts FROM 'E:/Master/NLP/project/iaprtc12/iaprtc12/Postgres/yagoLiteralFacts.tsv' NULL AS ''
-- Remove facts on which we cannot build the index
DELETE FROM yagofacts WHERE length(object)>1000;
-- Creating indexes
CREATE INDEX yagoIndexSubject ON yagoFacts(subject);
CREATE INDEX yagoIndexObject ON yagoFacts(object);
CREATE INDEX yagoIndexValue ON yagoFacts(value);
CREATE INDEX yagoIndexPredicate ON yagoFacts(predicate);
CREATE INDEX yagoIndexId ON yagoFacts(id);
CREATE INDEX yagoIndexSubjectPredicate ON yagoFacts(subject,predicate);
CREATE INDEX yagoIndexObjectPredicate ON yagoFacts(object,predicate);
CREATE INDEX yagoIndexValuePredicate ON yagoFacts(value,predicate);
-- Creating index for case-insensitive search
-- (you may abort the script if you don't need this index)
CREATE INDEX yagoIndexLowerObject ON yagofacts (lower(object));
-- done
the code gives me this error
ERROR: syntax error at or near ""
LINE 18: copy yagoFacts FROM 'yagoGeonamesGlosses.tsv' NULL AS '';
^
SQL state: 42601
Character: 549
I try to remove the
before the copy statement and this error appeared
ERROR: syntax error at or near "copy"
LINE 9: copy yagoFacts FROM 'E:/Master/NLP/project/iaprtc12/iaprtc12...
^
SQL state: 42601
Character: 348
question from:
https://stackoverflow.com/questions/65883340/importing-yago-sql-importer-with-pgadmin-4 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…