What do you think this attempt by using create type and create a function? Managing Key/Value Pairs in PostgreSQL (justatheory.com) <https://justatheory.com/2010/08/postgres-key-value-pairs/>
Regards, David On Wed, 5 Jan 2022 at 14:54, Tom Lane <t...@sss.pgh.pa.us> wrote: > Shaozhong SHI <shishaozh...@gmail.com> writes: > > How best to create and use associative array type in Postgres? > > I think the closest thing you'd find to that is jsonb, or > contrib/hstore if you'd like something with a bit less complexity. > The notation is unlikely to look much like Oracle, but they > both have the ability to store sets of key/value pairs. > > https://www.postgresql.org/docs/current/datatype-json.html > https://www.postgresql.org/docs/current/hstore.html > > regards, tom lane >