age icon indicating copy to clipboard operation
age copied to clipboard

agtype to jsonb conversion

Open stanislav-a-frolov opened this issue 1 year ago • 3 comments

Hello, everyone.

I'd like to have an agtype to jsonb conversion, so I would be able to write less complicated sql or use Postgresql drivers. It was mentioned in docs that agtype is quite close to jsonb, so would such conversion be fast enough for large objects?

stanislav-a-frolov avatar Nov 10 '22 06:11 stanislav-a-frolov

AGTYPE is based on JSONB and uses modified PG routines for JSONB. So, it is as fast as JSONB. However, it contains some additions to JSONB so it is not 1 to 1. There are functions available for typecasting some items back and forth between AGTYPE and PG datatypes.

If by complicated SQL you mean the wrapping SQL,... that is due to the nature of PG extensions and what we can and cannot do. It is also why we need to use a container datatype like AGTYPE.

jrgemignani avatar Nov 10 '22 18:11 jrgemignani

Hi! JSONB functions have evolved in the last years, so fast as AGE... And perhaps it's time to look back and review (or fork) the compatibility goals between AGE framework and JSONB.

There are a fast, secure and orthogonal (reversible) typecasting between AGTYPE and JSONB?

@jrgemignani can you list here? For:

  • Cast-performance discussion
  • Functional redundancy discussion

ppKrauss avatar Jun 05 '23 11:06 ppKrauss

@ppKrauss can you share how JSONB functions have evolved in the past few years? This might be useful in seeing what changes we can/should make. Thanks~

dehowef avatar Jun 05 '23 22:06 dehowef