Using regex in WHERE in Postgres Using regex in WHERE in Postgres postgresql postgresql

Using regex in WHERE in Postgres


Write instead:

select * from table where name ~ 'foo'

The '~' operator produces a boolean result for whether the regex matches or not rather than extracting the matching subgroups.