pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Shaozhong SHI <shishaozhong@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: How best to create and use associative array type in Postgres?
Date: Wed, 5 Jan 2022 12:34:50 -0800
Message-ID: <eca47936-bd32-58ae-94d0-fd44700038b1@aklaver.com> (raw)
In-Reply-To: <CA+i5JwZEVzxPyMo7VEZkn+w8Kh6J5RkrF+vRd65Mf0_G1CNLzw@mail.gmail.com>
References: <CA+i5JwYkKoQzWBfrkCLKo7PM-bPrb7cy7jz0W74XHVmCkePqGw@mail.gmail.com>
	<41274.1641394465@sss.pgh.pa.us>
	<CA+i5JwZRMwu_Mo8wfrS-_VWANG+RpaGEXth_orym-s_2joKKYA@mail.gmail.com>
	<299857.1641399856@sss.pgh.pa.us>
	<CA+i5JwZEVzxPyMo7VEZkn+w8Kh6J5RkrF+vRd65Mf0_G1CNLzw@mail.gmail.com>

On 1/5/22 12:26, Shaozhong SHI wrote:
> Have a look at this one.
> 
> GitHub - theory/kv-pair: A key/value pair data type for PostgreSQL 
> <https://github.com/theory/kv-pair;
> 
> There is no documentation on how to use it.

Why use it when you have:

https://www.postgresql.org/docs/current/datatype-json.html

Or if you want something simpler:

https://www.postgresql.org/docs/current/hstore.html

> 
> Regards,
> 
> David
> 
> On Wed, 5 Jan 2022 at 16:24, Tom Lane <tgl@sss.pgh.pa.us 
> <mailto:tgl@sss.pgh.pa.us>> wrote:
> 
>     Shaozhong SHI <shishaozhong@gmail.com
>     <mailto:shishaozhong@gmail.com>> writes:
>      > What do you think this attempt by using create type and create a
>     function?
>      > Managing Key/Value Pairs in PostgreSQL (justatheory.com
>     <http://justatheory.com;)
>      > <https://justatheory.com/2010/08/postgres-key-value-pairs/
>     <https://justatheory.com/2010/08/postgres-key-value-pairs/>;
> 
>     The date alone should suggest to you that there might be
>     better ways to do it by now.
> 
>                              regards, tom lane
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (6+ messages)

Message-ID: <eca47936-bd32-58ae-94d0-fd44700038b1@aklaver.com>
Permalink:  ../eca47936-bd32-58ae-94d0-fd44700038b1@aklaver.com/
Also on:    postgresql.org/message-id/eca47936-bd32-58ae-94d0-fd44700038b1@aklaver.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: adrian.klaver@aklaver.com, shishaozhong@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: How best to create and use associative array type in Postgres?
  In-Reply-To: <eca47936-bd32-58ae-94d0-fd44700038b1@aklaver.com>
  References: <CA+i5JwYkKoQzWBfrkCLKo7PM-bPrb7cy7jz0W74XHVmCkePqGw@mail.gmail.com> <41274.1641394465@sss.pgh.pa.us> <CA+i5JwZRMwu_Mo8wfrS-_VWANG+RpaGEXth_orym-s_2joKKYA@mail.gmail.com> <299857.1641399856@sss.pgh.pa.us> <CA+i5JwZEVzxPyMo7VEZkn+w8Kh6J5RkrF+vRd65Mf0_G1CNLzw@mail.gmail.com> <eca47936-bd32-58ae-94d0-fd44700038b1@aklaver.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