Found:
CREATE TABLE publishers(id INT, info JSON);
CREATE INDEX ON publishers((info->>'name'));
As stated in the comments, the subtle difference here is ->>
instead of ->
. The former one returns the value as text, the latter as a JSON object.
More Related Contents:
- How do I modify fields inside the new PostgreSQL JSON datatype?
- Check if a Postgres JSON array contains a string
- How do I query using fields inside the new PostgreSQL JSON datatype?
- Index for finding an element in a JSON array
- Flatten aggregated key/value pairs from a JSONB field?
- Explanation of JSONB introduced by PostgreSQL
- Postgres: How to convert a json string to text?
- How to query a json column for empty objects?
- PostgreSQL return result set as JSON array?
- Query for element of array in JSON column
- How to convert postgres json to integer
- Postgres JSON data type Rails query
- PostgreSQL Index on JSON
- Merging JSONB values in PostgreSQL?
- Collect Recursive JSON Keys In Postgres
- Size limit of JSON data type in PostgreSQL
- In postgresql, how can I return a boolean value instead of string on a jsonb key?
- Do the JSON keys have to be surrounded by quotes?
- Setting Access-Control-Allow-Origin in ASP.Net MVC – simplest possible method
- Unmarshal JSON with some known, and some unknown field names
- Django JSONField inside ArrayField
- List columns with indexes in PostgreSQL
- Split given string and prepare case statement
- Best way to save data in Unity game [closed]
- PowerShell 2.0 ConvertFrom-Json and ConvertTo-Json implementation
- Json Java serialization that works with GWT [closed]
- Coldfusion 10 returnformat=”JSON” adding characters
- Iterate a Json Object with ngFor
- respond to http request with json object in portlet
- Is there an API call for changing user password on keycloak?