What do you think this attempt by using create type and create a function?
Regards,
David
On Wed, 5 Jan 2022 at 14:54, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
Shaozhong SHI <shishaozhong@xxxxxxxxx> 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