with recursive s as (select (random() * 1e9)::bigint as n, 0 nested union all select (random() * 1e9)::bigint, nested+1 from s where nested < 1e6) select n from s where not exists (select from tablename where tablename.serialNumber = s.n) limit 1;
я так понимаю checkpoint должен вырезать все wal до pg_last_wal_replay_lsn
2019-06-26 09:46:35 MSK < > %LOG: 00000: restartpoint starting: xlog
2019-06-26 09:51:25 MSK < > %LOG: 00000: restartpoint complete: wrote 670602 buffers (5.3%); 0 WAL file(s) added, 441 removed, 0 recycled; write=269.418 s, sync=0.421 s, total=289.467 s; sync files=199, longest=0.122 s, average=0.002 s; distance=4590361 kB, estimate=8031162 kB
SELECT conname, conrelid::pg_catalog.regclass,
pg_catalog.pg_get_constraintdef(c.oid, true) as condef
FROM pg_catalog.pg_constraint c
WHERE c.confrelid = '26291' AND c.contype = 'f' ORDER BY 1;
The max_allowed_packet system variable controls the maximum size of parameter values that can be sent with mysql_stmt_send_long_data().