mirror of
https://github.com/rasilon/ujetl.git
synced 2026-04-11 18:39:30 +00:00
104 lines
3.2 KiB
XML
104 lines
3.2 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<CopyingApp>
|
|
<hardLimitSeconds>360000</hardLimitSeconds>
|
|
<nRowsToLog>10000</nRowsToLog>
|
|
<blockSize>1000</blockSize>
|
|
<pollTimeout>500</pollTimeout>
|
|
<source>
|
|
<dsn>jdbc:postgresql://localhost:5432/test</dsn>
|
|
<username>test</username>
|
|
<password>test</password>
|
|
<networkTimeout>600000</networkTimeout>
|
|
</source>
|
|
<dest>
|
|
<dsn>jdbc:postgresql://localhost:5432/test</dsn>
|
|
<username>test</username>
|
|
<password>test</password>
|
|
</dest>
|
|
<jobs>
|
|
<job>
|
|
<name>test</name>
|
|
<identifySourceSQL>select 'PID:'||pg_backend_pid()</identifySourceSQL>
|
|
<identifyDestinationSQL>select 'PID:'||pg_backend_pid()</identifyDestinationSQL>
|
|
<key>select coalesce(-1,max(id),-1) as key from dest</key>
|
|
<select>
|
|
select
|
|
id,
|
|
test_int,
|
|
test_text,
|
|
test_ts
|
|
from
|
|
public.source where id > ?::bigint</select>
|
|
<insert>
|
|
insert into public.dest(
|
|
id,
|
|
test_int,
|
|
test_text,
|
|
test_ts
|
|
)values(
|
|
?::bigint,
|
|
?::integer,
|
|
?::text,
|
|
?::timestamp with time zone
|
|
)ON CONFLICT(id) DO UPDATE
|
|
set
|
|
test_int = EXCLUDED.test_int,
|
|
test_text = EXCLUDED.test_text,
|
|
test_ts = EXCLUDED.test_ts
|
|
WHERE
|
|
dest.test_int = EXCLUDED.test_int
|
|
OR dest.test_text = EXCLUDED.test_text
|
|
OR dest.test_ts = EXCLUDED.test_ts
|
|
</insert>
|
|
</job>
|
|
<job>
|
|
<name>test upsert</name>
|
|
<key>select -1 as key</key>
|
|
<select>
|
|
select
|
|
id,
|
|
test_int,
|
|
test_text,
|
|
test_ts
|
|
from
|
|
public.source where id > ?::bigint</select>
|
|
<insert>
|
|
insert into public.dest(
|
|
id,
|
|
test_int,
|
|
test_text,
|
|
test_ts
|
|
)values(
|
|
?::bigint,
|
|
?::integer,
|
|
?::text,
|
|
?::timestamp with time zone
|
|
)ON CONFLICT(id) DO UPDATE
|
|
set
|
|
test_int = EXCLUDED.test_int,
|
|
test_text = EXCLUDED.test_text,
|
|
test_ts = EXCLUDED.test_ts
|
|
WHERE
|
|
dest.test_int IS DISTINCT FROM EXCLUDED.test_int
|
|
OR dest.test_text IS DISTINCT FROM EXCLUDED.test_text
|
|
OR dest.test_ts IS DISTINCT FROM EXCLUDED.test_ts
|
|
</insert>
|
|
</job>
|
|
<job>
|
|
<name>denormalise</name>
|
|
<key>select -1 as key</key>
|
|
<select>select person_id,fname,lname from normalised_personalia p join normalised_first_names f using(fid) join normalised_last_names l using(lid);</select>
|
|
<insert>
|
|
INSERT INTO denormalised_personalia(person_id,fname,lname)
|
|
values(?::integer,?::text,?::text)
|
|
ON CONFLICT (person_id) DO UPDATE
|
|
SET
|
|
fname = EXCLUDED.fname,
|
|
lname = EXCLUDED.lname
|
|
WHERE
|
|
denormalised_personalia.fname is distinct from EXCLUDED.fname
|
|
OR denormalised_personalia.lname is distinct from EXCLUDED.lname
|
|
</insert>
|
|
</job>
|
|
</jobs>
|
|
</CopyingApp>
|