Home

2023-01-26 | Query JSONB column in Postgres

(Turn your phone sideways if you are on mobile)

This was a Today I Learned (TIL) for me. Here is the syntax to query a JSONB column in Postgres:


select id, worker, errors
from oban_jobs
where args ->> 'an_id' = 'c2d70b80-b4b2-4e96-b0ed-ca746a0fc631'
order by inserted_at desc

Conclusion

So cool!

--------------

Thanks for reading, PDG

Home