Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/sql/40-funcs.sql
Show First 20 Lines • Show All 592 Lines • ▼ Show 20 Lines | |||||
-- Create entries in extid from tmp_extid | -- Create entries in extid from tmp_extid | ||||
-- operates in bulk: 0. swh_mktemp(extid), 1. COPY to tmp_extid, | -- operates in bulk: 0. swh_mktemp(extid), 1. COPY to tmp_extid, | ||||
-- 2. call this function | -- 2. call this function | ||||
create or replace function swh_extid_add() | create or replace function swh_extid_add() | ||||
returns void | returns void | ||||
language plpgsql | language plpgsql | ||||
as $$ | as $$ | ||||
begin | begin | ||||
insert into extid (extid_type, extid, extid_version, target_type, target) | insert into extid (extid_type, extid, extid_version, target_type, target, payload_type, payload) | ||||
select distinct t.extid_type, t.extid, t.extid_version, t.target_type, t.target | select distinct t.extid_type, t.extid, t.extid_version, t.target_type, t.target, t.payload_type, t.payload | ||||
from tmp_extid t | from tmp_extid t | ||||
on conflict do nothing; | on conflict do nothing; | ||||
return; | return; | ||||
end | end | ||||
$$; | $$; | ||||
-- Create entries in person from tmp_release | -- Create entries in person from tmp_release | ||||
▲ Show 20 Lines • Show All 421 Lines • Show Last 20 Lines |