I am passing a parameter into a Postgres query which allows the user to set the LIMIT
of the result set. This parameter is optional and I would like to set the default LIMIT
to infinite (no limit) but I'm not sure what to pass in this case. Would a limit of -1 be viewed as no limit?
Quote from the manual
If the count expression evaluates to
NULL
, it is treated asLIMIT ALL
, i.e., no limit
So just pass NULL
for the limit and you'll get all rows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With