You can use direct call to a function jsonb_exists_any()
.
So in your case it would be
jsonb_exists_any(u.authorities::jsonb, array['ROLE_1', 'ROLE_2'])
More Related Contents:
- how to store PostgreSQL jsonb using SpringBoot + JPA?
- How to perform update operations on columns of type JSONB in Postgres 9.4
- Postgresql query array of objects in JSONB field
- PostgreSQL jsonb, `?` and JDBC
- Insert, on duplicate update in PostgreSQL?
- How does the search_path influence identifier resolution and the “current schema”
- Run batch file with psql command without password
- invalid byte sequence for encoding “UTF8”
- Postgresql: Conditionally unique constraint
- How to make “case-insensitive” query in Postgresql?
- Rownum in postgresql
- Cannot create a database table named ‘user’ in PostgreSQL
- How to make connection to Postgres via Node.js
- Postgresql Truncation speed
- Buffers (Circle) in PostGIS
- How to customize the configuration file of the official PostgreSQL Docker image?
- Heroku “psql: FATAL: remaining connection slots are reserved for non-replication superuser connections”
- Changing primary key int type to serial
- Return SETOF rows from PostgreSQL function
- Postgresql insert trigger to set value
- postgres autoincrement not updated on explicit id inserts
- Retrieving Comments from a PostgreSQL DB
- Docker – How can run the psql command in the postgres container?
- Postgis installation: type “geometry” does not exist
- How do I change a Crystal Report’s ODBC database connection at runtime?
- PostgreSQL via SSH Tunnel
- How should I import data from CSV into a Postgres table using pgAdmin 3?
- PostgreSQL – set a default cell value according to another cell value
- Loop on tables with PL/pgSQL in Postgres 9.0+
- What’s the difference between pg_table_size, pg_relation_size & pg_total_relation_size? (PostgreSQL)