Description
running a test suite using sqlspec and asyncpg I noticed the following log on my db, I suppose it's coming from sqlspec but not 100% sure.
2026-02-06 14:04:58.742 UTC [96] ERROR: syntax error at or near ":" at character 494
2026-02-06 14:04:58.742 UTC [96] STATEMENT: SELECT
a.attname::text AS column_name,
pg_catalog.pg_get_expr(d.adbin, d.adrelid)::text AS column_default,
pg_catalog.format_type(a.atttypid, a.atttypmod) AS data_type,
CASE WHEN a.attnotnull THEN 'NO' ELSE 'YES' END AS is_nullable
FROM pg_catalog.pg_attribute AS a
INNER JOIN pg_catalog.pg_class AS c ON a.attrelid = c.oid
INNER JOIN pg_catalog.pg_namespace AS n ON c.relnamespace = n.oid
LEFT JOIN
pg_catalog.pg_attrdef AS d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE
c.relname =: table_name
AND n.nspname =: schema_name
AND a.attnum > 0
AND NOT a.attisdropped
ORDER BY a.attnum;
I suppose sqlspec runs some introspection queries ?
if yes and this comes from
|
WHERE c.relname = :table_name |
then look at the slight difference ie the space, my docker db container tells me
c.relname =: table_name
so there might be a slight error in the replacement of bind-parameters and I wouldnt be surprised if the casting above in the query with 2 colons doest mess with the parsing.
URL to code causing the issue
No response
MCVE
Steps to reproduce
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
Screenshots
"In the format of: "
Logs
Package Version
0.38.4
Platform
Description
running a test suite using sqlspec and asyncpg I noticed the following log on my db, I suppose it's coming from sqlspec but not 100% sure.
I suppose sqlspec runs some introspection queries ?
if yes and this comes from
sqlspec/sqlspec/data_dictionary/sql/postgres/columns.sql
Line 12 in c72f086
c.relname =: table_nameso there might be a slight error in the replacement of bind-parameters and I wouldnt be surprised if the casting above in the query with 2 colons doest mess with the parsing.
URL to code causing the issue
No response
MCVE
# Your MCVE code hereSteps to reproduce
Screenshots
"In the format of:
"Logs
Package Version
0.38.4
Platform