Re: Create and access a dictionary type

2022-01-05 Thread Rob Sargent
>> >> 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. > > Contributing mightily to the global angular m

Re: Create and access a dictionary type

2022-01-05 Thread Ron
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

Re: Create and access a dictionary type

2022-01-05 Thread Tomas Vondra
On 1/5/22 14:36, Shaozhong SHI wrote: I just checked operators.  I could not find any operator to set a new value given a key. I'd say jsonb_set is what you're looking for. Postgres does not have a thing that'd match the Oracle feature exactly, you'll have to adjust your application to use

Re: Create and access a dictionary type

2022-01-05 Thread Tomas Vondra
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

Re: Create and access a dictionary type

2022-01-05 Thread Ron
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.

Re: Create and access a dictionary type

2022-01-05 Thread Shaozhong SHI
I just checked operators. I could not find any operator to set a new value given a key. Regards, David On Wed, 5 Jan 2022 at 13:22, 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? > >

Re: Create and access a dictionary type

2022-01-05 Thread Tomas Vondra
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. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.c

Create and access a dictionary type

2022-01-05 Thread Shaozhong SHI
Any examples in Postgres to create a dictionary type to store and access key value pairs? Regards, David