cockroachdb crdb - enums not working with prepared statements
See original GitHub issue- asyncpg version: 0.21.0
- CockroachDB version: v20.2.1
- PostgreSQL version: 12.4
- Do you use a PostgreSQL SaaS? If so, which? Can you reproduce the issue with a local PostgreSQL install?:
- Python version: 3.9.0
- Platform: linux-x86_64
- 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?: didn’t test uvloop
enums have just been added to crdb. testing asyncpg shows an issue with prepared statements.
running this:
await conn.execute("INSERT INTO accounts2 (id, balance, mode) VALUES ($1, $2, $3)", 9, 2000, "active", )
throws
statement = await self._protocol.prepare(stmt_name, query, timeout)
File "asyncpg/protocol/protocol.pyx", line 163, in prepare
asyncpg.exceptions.FeatureNotSupportedError: CTEs may not be correlated
the prepared statement works fine in pgsql. enums work fine without prepared statements.
I have a silly bug exerciser, but needs some cleanup, you can see the relevant test2 functions if you need working code. i’ve tested psycopg2 and asyncpg against crdb and pgsql and out of the four runs, only asyncpg+crdb shows an issue.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8
Top Results From Across the Web
cockroachdb crdb - enums not working with prepared statements
cockroachdb crdb - enums not working with prepared statements. MagicStack. 24 November 2020 Posted by toppk. asyncpg version: 0.21.0; CockroachDB version: ...
Read more >Known Limitations in CockroachDB v22.2
If the number of columns has increased, the prepared statement returns an error but nonetheless writes the data. If the number of columns...
Read more >SQL Statements | CockroachDB Docs
View the CREATE statement for a database, function, sequence, table, or view. SHOW DATABASES, List databases in the cluster. SHOW ENUMS, List user-defined, ......
Read more >ENUM | CockroachDB Docs
A user-defined ENUM data type consists of a set of enumerated, static values. Syntax. To declare a new ENUM data type, use CREATE...
Read more >Build a Simple CRUD Java App with CockroachDB and JDBC
Learn how to use CockroachDB from a simple Java application with the JDBC ... the args and insert them into the // prepared...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Version 21.2 of CockroachDB will support correlated CTEs (https://github.com/cockroachdb/cockroach/pull/63956) – hopefully that will help.
Just to clarify, what is the error you get with the
query?