Seaquel
PostgreSQL error code

PostgreSQL error 2202H

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

SQLSTATE2202H
Condition nameinvalid_tablesample_argument
Class22 — Data Exception

Reproduce it, then fix it

TABLESAMPLE takes the percentage of the table to sample, from 0 to 100. 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 BERNOULLI (150);
SELECT name FROM products TABLESAMPLE BERNOULLI (50);

Source: PostgreSQL documentation, Appendix A