question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parametrized queries do not support LIMIT ALL

See original GitHub issue

When using a query with LIMIT $1, with $1 populated with the string "ALL", we get this error

invalid input syntax for type bigint: "ALL"

According to the doc, that should be supported by PostgreSQL: https://www.postgresql.org/docs/8.1/queries-limit.html

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
sehropecommented, Apr 18, 2022

Yes LIMIT $1 with a null value to fetch all the rows is supported going back to PostgreSQL server version 8.4: https://www.postgresql.org/docs/8.4/queries-limit.html (released in 2009 and EOL in 2014)

1reaction
benny-medflytcommented, Jan 13, 2022

You can use LIMIT $1 and pass null if you want all the rows

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using parameterized queries - Amazon Athena
Parameterized queries are supported only in Athena engine version 2 and later ... To clear all of the values that you entered at...
Read more >
Running parameterized queries | BigQuery
BigQuery supports query parameters to help prevent SQL injection when queries are constructed using user input. This feature is only available with Google ......
Read more >
SQL Injection Prevention Cheat Sheet
The use of prepared statements with variable binding (aka parameterized queries) is how all developers should first be taught how to write database...
Read more >
Preventing SQL Injection in PHP without parameterized ...
So basically I'm asking what my options are here? I've run mysqli_real_escape_string over the inputs. I've setup a filter which doesn't allow words...
Read more >
SQL Server Performance by Query Type | Blog
Microsoft SQL Server has a limit on the number of parameters that a parameterized query can have (2100). However, many of our queries...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found