Feb 4, 2025
0
Level 3
integer array search from postgres using laravel
hello everyone I am having a problem with selecting/filtering using integer[] on postgres.
$query->whereRaw("($my_integer_array_value) = some(my_integer_array)");
// the $query is the result of getQuery() from model
// e.g: User::getQuery();
and it's returning the empty set data but on the database I have some rows with this credentials and postgres is returning the data when I run this SQL command on PGAdmin
SELECT * FROM my_table WHERE 159753 = some(my_integer_array);
Environment:
OS: Arch Linux
PHP Version: 8.2.26
PostgreSQL: 17.2
Laravel: 9.19
I tried several SQL Queries and they are working in the console but not working in laravel
Please or to participate in this conversation.