I use PostgreSQL ltree
in a CakePHP 2.X controller and I found when I use the query like below:
$this->UserInfo->query(
'select * from user_infos where path ? \'{'Test1.1','Test2.1'}\''
);
It can execute through the psql. The format due to ltree ? lquery[]
it will throw an error:
Error: SQLSTATE[42601]: Syntax error: 7
ERROR: syntax error at or near "[" LINE 1:
...t * from user_infos where where path $1 \'{'Test1.1 ... ^
It seems the PDO treats ? as $1 argument?
Anyone has idea to prevent the problem?