By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
CREATE TABLE
INSERT 0 1
id | en_name | names |
---|---|---|
1 | null | {"short": null, "common": [{"value": "برونشوايغ", "language": "ar"}, {"value": "برانشویگ", "language": "ur"}, {"value": "برونشوایگ", "language": "fa"}, {"value": "Брауншвейг", "language": "ru"}, {"value": "Breunswyk", "language": "fy"}, {"value": "Braunšveiga", "language": "lv"}, {"value": "Brunszwik", "language": "pl"}, {"value": "Braunschweig", "language": "local"}, {"value": "Brunswick", "language": "fr"}, {"value": "Brunswick", "language": "es"}, {"value": "Brunswick", "language": "en"}]} |
SELECT 1
id | name |
---|---|
1 | برونشوايغ |
SELECT 1
id | en_name |
---|---|
1 | null |
SELECT 1
ERROR: syntax error at or near "JSONB_ARRAY_ELEMENTS" LINE 4: JSONB_ARRAY_ELEMENTS(common->'value') as name_value, ^
ERROR: operator is not unique: unknown ->> unknown LINE 1: SELECT id,'common'->>'value' AS en_name ^ HINT: Could not choose a best candidate operator. You might need to add explicit type casts.