1
|
CREATE TEMPORARY TABLE tmp_simrels (
|
2
|
local_id text NOT NULL,
|
3
|
oa_original_id text NOT NULL,
|
4
|
oa_name text NOT NULL,
|
5
|
oa_acronym text,
|
6
|
oa_country text,
|
7
|
oa_url text,
|
8
|
oa_collectedfrom text
|
9
|
);
|
10
|
|
11
|
COPY tmp_simrels(local_id, oa_original_id, oa_name, oa_acronym, oa_country, oa_url, oa_collectedfrom) FROM '/Users/michele/Develop/dnet45/dnet-orgs-database-application/src/main/resources/tmp_data/rels.part-r-00000.tsv' DELIMITER E'\t';;
|
12
|
|
13
|
INSERT INTO openaire_simrels (local_id, oa_original_id, oa_name, oa_acronym, oa_country, oa_url, oa_collectedfrom)
|
14
|
SELECT local_id, oa_original_id, oa_name, oa_acronym, oa_country, oa_url, oa_collectedfrom
|
15
|
FROM tmp_simrels
|
16
|
ON CONFLICT DO NOTHING;
|
17
|
|