Seaquel
PostgreSQL error code

PostgreSQL error 2202G

2202G is the SQLSTATE PostgreSQL reports for invalid tablesample repeat, in class 22, Data Exception.

SQLSTATE2202G
Condition nameinvalid_tablesample_repeat
Class22 — Data Exception

Reproduce it, then fix it

REPEATABLE takes the seed that makes the sample the same on every run, and the seed can’t be NULL. Any number works. Run the broken query to see the error, then switch to the fixed one. Edit either freely; every run is rolled back.

SELECT name FROM products TABLESAMPLE SYSTEM (50) REPEATABLE (NULL);
SELECT name FROM products TABLESAMPLE SYSTEM (50) REPEATABLE (42);

Source: PostgreSQL documentation, Appendix A