Re: Create and access a dictionary type

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Create and access a dictionary type
Date: 2022-01-05 16:57:34
Message-ID: 71d93298-b172-9474-f3ff-96293a7f1524@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/5/22 10:35 AM, Tomas Vondra wrote:
> On 1/5/22 17:24, Ron wrote:
>> On 1/5/22 7:22 AM, Tomas Vondra wrote:
>>> On 1/5/22 14:17, Shaozhong SHI wrote:
>>>> Any examples in Postgres to create a dictionary type to store and
>>>> access key value pairs?
>>>>
>>>
>>> I'd say JSONB can be used as an associative array, and e.g. in Python
>>> can map to dict data type.
>>
>> The question confuses me.  Why isn't "create a table with Primary Key"
>> the answer to "Any examples in Postgres to create a dictionary type to
>> store and access key value pairs?"
>>
>
> Well, yes - you can always decompose the dict and store it in an EAV, but
> sometimes it's more convenient to just use "nested" dictionary at the row
> level. Which is what a JSONB column does.

Edgar Codd is rolling in his grave.

--
Angular momentum makes the world go 'round.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2022-01-05 16:59:43 Re: Create and access a dictionary type
Previous Message Tomas Vondra 2022-01-05 16:37:14 Re: Create and access a dictionary type