MaxPower
MaxPower

Reputation: 871

Postgres query must be of type boolean

I am using skife to help with my database queries. I have the query and method below.

@SqlQuery("select * from profile where profile_id >= :from and profile_id < :to")
List<Profile> findAllInRange(@Bind("from")int from, @Bind("to")int to);

I get the following error

org.postgresql.util.PSQLException: ERROR: argument of AND must be type boolean, not type bigint

But if I execute this query

select * from profile where profile_id >= 1 and profile_id < 50

my RDBMS returns the results successfully.

What am I missing?

Upvotes: 1

Views: 387

Answers (1)

MaxPower
MaxPower

Reputation: 871

Credit to MinMiguelM

I needed to place \\ before the < operator

Upvotes: 1

Related Questions