When using Redshift - PostgresSyntaxError: syntax error at or near "ORDER" - in query with no "ORDER"
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
Comienza con el punto de entrada connection.fetch y la consulta reproducida select 'all' = any($1::text[]), y luego compara su comportamiento en Redshift con el de la imagen Docker de PostgreSQL indicada. Determina si el error de sintaxis se origina en asyncpg o en Redshift, y documenta una solución alternativa confirmada o la limitación de compatibilidad.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
- asyncpg version: asyncpg==0.27.0.
- PostgreSQL version: PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.46987.
- Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
the issue with a local PostgreSQL install?: I am using Amazon Redshift. I could not reproduce the issue withpotgres:9.0Docker image. - Python version: Python 3.9.12.
- Platform: Windows 10 Pro, 22H2, 19045.2604.
- Do you use pgbouncer?: No.
- Did you install asyncpg with pip?: Yes.
- If you built asyncpg locally, which version of Cython did you use?: -
- Can the issue be reproduced under both asyncio and
uvloop?: Have not trieduvloop.
Running this snippet:
options = ConnectionOptions()
sslctx = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
sslctx.check_hostname = False
sslctx.verify_mode = ssl.CERT_NONE
connection = await asyncpg.connect(options.dsn, ssl=sslctx)
try:
query = "select 'all' = any($1::text[])"
await connection.fetch(query, ["all"])
finally:
await connection.close()
I get this exception:
asyncpg.exceptions.PostgresSyntaxError: syntax error at or near "ORDER"
I am wondering, where the "syntax error at or near "ORDER" comes from, as there is no "ORDER" in the original query.
If asyncpg does not rewrite queries in any way, and the query passed to fetch is forwarded to the database without modification (https://github.com/MagicStack/asyncpg/issues/434#issuecomment-910474719, https://github.com/MagicStack/asyncpg/discussions/859#discussioncomment-1742492) - where does the "ORDER" come from?
Can this issue be worked around, or I should abandon asyncpg as a Redshift client? I do understand that Redshift is not officially supported, but this client is very good otherwise.
I was not able to reproduce the error with the postgres:9.0 instance (the oldest I was able to find quickly). The same (except ssl=False) snippet works without errors.
- Lenguaje dominante
- Python
- Estrellas
- 8.1k
- Forks
- 469
- Merge medio
- 4 d 1 h
- PR fusionados (30 d)
- 14
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MagicStack/asyncpg
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
MagicStack/asyncpg#1357 · 1 comentario · 1 reacción ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
MagicStack/asyncpg#1342 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 56/100
MagicStack/asyncpg#1340 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 28/100
MagicStack/asyncpg#1337 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
MagicStack/asyncpg#1330 · 1 comentario ·
Todos los issues de MagicStack/asyncpg
Issues similares
-
[Bug] reef-hermes tells me to resume with hermes --resume, which does not work from my shell Abiertoarea: harness bug status: needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Human-Agent-Society/reef#625 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
learningequality/kolibri#15351 · 2 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Name consistency Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
eellak/triplestore#65 · 1 comentario ·