Troubleshooting of PostgreSQL: Difference between revisions
Jump to navigation
Jump to search
no edit summary
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
Troubleshooting of PostgreSQL | Troubleshooting of PostgreSQL | ||
== Syntax error: 7 ERROR: LIMIT #,# syntax is not supported == | == How to fix Syntax error: 7 ERROR: LIMIT #,# syntax is not supported == | ||
Query syntax mer error | Query syntax mer error | ||
<pre> | <pre> | ||
| Line 22: | Line 22: | ||
</pre> | </pre> | ||
== How to fix ERROR: operator does not exist: ` character varying == | |||
The following SQL query has a syntax error: | |||
<pre> | |||
SELECT `my_columm` | |||
from my_table | |||
LIMIT 10 | |||
</pre> | |||
Error message | |||
<pre> | |||
ERROR: operator does not exist: ` character varying | |||
LINE 1: SELECT `content_hash` | |||
^ | |||
HINT: No operator matches the given name and argument type. You might need to add an explicit type cast. | |||
</pre> | |||
To fix the error, update the query with the correct syntax: | |||
<pre> | |||
SELECT my_columm | |||
from my_table | |||
LIMIT 10 | |||
</pre> | |||
== ERROR: | == How to fix ERROR: argument of WHERE must be type boolean, not type integer == | ||
Query syntax mer error | Query syntax mer error | ||
<pre> | <pre> | ||
| Line 47: | Line 67: | ||
</pre> | </pre> | ||
== How to fix the ERROR: column "count" does not exist == | |||
The following SQL query has a syntax error: | |||
<pre> | |||
SELECT count(*) count, content_hash | |||
from my_table | |||
GROUP BY content_hash | |||
having count >= 2 | |||
</pre> | |||
To fix the error, update the query with the correct syntax: | |||
<pre> | |||
SELECT count(*) count, content_hash | |||
from my_table | |||
GROUP BY content_hash | |||
having count(*) >= 2 | |||
</pre> | |||
== Further reading == | |||
* [https://stackoverflow.com/questions/242822/why-would-someone-use-where-1-1-and-conditions-in-a-sql-clause dynamic sql - Why would someone use WHERE 1=1 AND <conditions> in a SQL clause? - Stack Overflow] | * [https://stackoverflow.com/questions/242822/why-would-someone-use-where-1-1-and-conditions-in-a-sql-clause dynamic sql - Why would someone use WHERE 1=1 AND <conditions> in a SQL clause? - Stack Overflow] | ||
* [https://koalatea.io/postgres-insert-ignore/ Working with Insert Into Ignore in Postgres] | |||
== References == | |||
<references /> | |||
== The numeric column data all became null after imported == | == The numeric column data all became null after imported == | ||