Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

VanDyckBrown's avatar

Postgres operator does not exist: boolean = integer

The error speaks for itself, the querie is trying to compare a boolean with an integer which is incorrect. However my eloquent query looks like this.

$logs = Logger::where('created_at', '>' , $validated["timestamp"])->where('frontend', true)->get();

The frontend field is a boolean.

Does laravel automaticly convert true to an integer because of the standard MySQL implementation?

I've got a feeling the issue has to do something with connection pooling, i have never run in to this issue before. I don't have this issue on my local environment and it all started after implementing session connection pooling on my managed postgresql database.

0 likes
2 replies
VanDyckBrown's avatar

Turns out this was caused by a setting in my config file:

        PDO::ATTR_EMULATE_PREPARES => true
startork's avatar

Hi @vandyckbrown and anyone else who has this problem

Turns out it's an issue from pgBouncer when using the PDO::ATTR_EMULATE_PREPARES => true config. (Which is necessary when using Transaction pool mode) Just installing the https://github.com/umbrellio/laravel-pg-extensions in our Laravel project fixed this for us! Hopefully this helps someone :)

Thanks

Please or to participate in this conversation.