Limiting a result in SQL is a somewhat sad story. To make it short, every database does things somewhat differently. Although there is actually a SQL standard on limiting results, not everybody fully supports the way things are supposed to be. The correct way to limit data is to actually use the following syntax:
test=# SELECT * FROM t_test FETCH FIRST 3 ROWS ONLY;
id
----
1
2
3
(3 rows)
If you have never seen this syntax before, don't worry. You are definitely not alone.