This page lists the errors people meet most often with this library, by the message you see, with the cause and the fix. The messages are copied from Doctrine DBAL 4.5 and ORM 3.7 on PostgreSQL 18; the platform class, the column number and the parameter number depend on your versions and your query.
Expected =, <, <=, <>, >, >=, !=, got end of string.
The same error can end in got 'ORDER', or in whatever else follows the function.
Cause: a function that returns a boolean stands alone in WHERE or HAVING. DQL accepts a function there only as part of a comparison; Boolean functions need a comparison explains the rule.
Fix: compare it with TRUE:
WHERECONTAINS(p.tags,ARRAY('php'))=TRUE
Expected =, <, <=, <>, >, >=, !=, got 'ILIKE'
Cause: the query uses PostgreSQL’s operator syntax, i.subject ILIKE 'test%', and DQL has no such operator. Function and operator names lists the DQL name of every operator.
Fix: call the function instead:
WHEREILIKE(i.subject,'test%')=TRUE
When the schema tool or a migration runs
Unknown database type "text[]" requested
Unknown database type "text[]" requested, Doctrine\DBAL\Platforms\PostgreSQL120Platform may not support it.
Cause: Doctrine is writing DDL for a column of this type and cannot find the type’s own name on the platform.
Unknown database type "_text" requested, Doctrine\DBAL\Platforms\PostgreSQL120Platform may not support it.
Cause: Doctrine is reading a column back from the database, for doctrine:schema:update or a migration diff, and PostgreSQL reports an array column’s type with a leading underscore. The schema tools read every table in the database, not only the ones your entities map, unless a schema filter limits them, so an unmapped array column anywhere triggers it.
Array values must be hex-encoded bytea strings starting with \x
Cause: the session’s bytea_output is escape, so PostgreSQL writes each bytea[] item in the escape format. This library reads only the default hex format.
Fix: switch the setting back to hex, for example for every new connection to the database:
ALTERDATABASEappSETbytea_output='hex';
getSingleScalarResult() returns '{php,postgres}' for an array field
Cause: the scalar result methods skip the DBAL type, even for a mapped field.
Fix: use getSingleResult() and take the column from the row; see Query results.