Generate test data
Use generate_series as a row source for a repeatable test table. Its bounds are inclusive, and expressions can derive other columns from the generated value.
Create a fixture
sql
CREATE TABLE samples(id INTEGER PRIMARY KEY, value INTEGER);
INSERT INTO samples
SELECT generate_series, generate_series * 10
FROM generate_series(1, 100);Verify the shape
sql
SELECT count(*) AS rows, min(value), max(value), sum(value)
FROM samples
FORMAT csv;text
100,10,1000,50500The fixture has stable values and no dependence on random state. A descending series needs a negative step; zero is an error. NULL bounds or an unreachable direction produce no rows.
Use a data distribution representative of the query being tested when comparing plans or timings. A small sequential fixture verifies behavior but does not establish performance on a different workload.
See generate_series for numeric and calendar inputs.