pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Create and access a dictionary type
Date: Wed, 5 Jan 2022 10:57:34 -0600
Message-ID: <71d93298-b172-9474-f3ff-96293a7f1524@gmail.com> (raw)
In-Reply-To: <bacb43b9-ec26-1adc-8334-dc2e74210c96@enterprisedb.com>
References: <CA+i5JwYG_m7Ka2Sw_p9r5-3LrRqz=4HsuccX-7oz4+SMtbmvhA@mail.gmail.com>
	<c699f135-2326-0fda-6623-850da6101bc8@enterprisedb.com>
	<def33987-b02b-c87d-f854-444989b80610@gmail.com>
	<bacb43b9-ec26-1adc-8334-dc2e74210c96@enterprisedb.com>

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.





view thread (8+ messages)  latest in thread

Message-ID: <71d93298-b172-9474-f3ff-96293a7f1524@gmail.com>
Permalink:  ../71d93298-b172-9474-f3ff-96293a7f1524@gmail.com/
Also on:    postgresql.org/message-id/71d93298-b172-9474-f3ff-96293a7f1524@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com, tomas.vondra@enterprisedb.com
  Subject: Re: Create and access a dictionary type
  In-Reply-To: <71d93298-b172-9474-f3ff-96293a7f1524@gmail.com>
  References: <CA+i5JwYG_m7Ka2Sw_p9r5-3LrRqz=4HsuccX-7oz4+SMtbmvhA@mail.gmail.com> <c699f135-2326-0fda-6623-850da6101bc8@enterprisedb.com> <def33987-b02b-c87d-f854-444989b80610@gmail.com> <bacb43b9-ec26-1adc-8334-dc2e74210c96@enterprisedb.com> <71d93298-b172-9474-f3ff-96293a7f1524@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox