DROP TABLE IF EXISTS regtest_data;
CREATE TABLE regtest_data (
id int,
x int[],
y numeric[],
z text[]
);
SELECT pgstrom.random_setseed(20190630);
INSERT INTO regtest_data (
SELECT x, array[pgstrom.random_int(2,0,1000),
pgstrom.random_int(2,0,1000),
pgstrom.random_int(2,0,1000)],
array[pgstrom.random_float(2,0.0,100.0)::numeric(9,2),
pgstrom.random_float(2,0.0,100.0)::numeric(9,2),
pgstrom.random_float(2,0.0,100.0)::numeric(9,2)],
array[pgstrom.random_text(2,'k***'),
pgstrom.random_text(2,'k***'),
pgstrom.random_text(2,'k***')]
FROM generate_series(1,5000) x
);
UPDATE regtest_data
SET x = array_append(x, pgstrom.random_int(2,0,1000)::int),
y = array_append(y, pgstrom.random_float(2,0.0,100.0)::numeric(9,2)),
z = array_append(z, pgstrom.random_text(2,'k***'))
WHERE id % 7 = 3;
# same query above
UPDATE regtest_data
SET x = array_append(x, pgstrom.random_int(2,0,1000)::int),
y = array_append(y, pgstrom.random_float(2,0.0,100.0)::numeric(9,2)),
z = array_append(z, pgstrom.random_text(2,'k***'))
WHERE id % 7 = 3;
postgres=# UPDATE regtest_data
postgres-# SET x = array_append(x, pgstrom.random_int(2,0,1000)::int),
postgres-# y = array_append(y, pgstrom.random_float(2,0.0,100.0)::numeric(9,2)),
postgres-# z = array_append(z, pgstrom.random_text(2,'k***'))
postgres-# WHERE id % 7 = 3;
UPDATE 714
postgres=# VACUUM;
VACUUM
postgres=# UPDATE regtest_data
postgres-# SET x = array_append(x, pgstrom.random_int(2,0,1000)::int),
postgres-# y = array_append(y, pgstrom.random_float(2,0.0,100.0)::numeric(9,2)),
postgres-# z = array_append(z, pgstrom.random_text(2,'k***'))
postgres-# WHERE id % 7 = 3;
UPDATE 714
The query to reproduce:
Error message
This can prevent by adding
VACUUM