From PostgreSQL wiki
Jump to navigationJump to search

Future of JSON

What people are using JSON for, binary representation, etc.

Peter talked about MoSQL & PL/v8. People don't know JSON from 9.3 yet.

What we need:

  • indexing

Dunstan published pgjpath on bitbucket, which implements jpath via PL/v8.

Need to think about what operations need to be supported via index. Like can jpath be indexable. Like trigram? We probably don't need find similarity.

Range queries? We would need to agree on types.

  • Numeric numbers (arbitrary length)
  • strings,
  • booleans,
  • and NULL.

Do we want to support timestamps? Mongo does this in BSON, we don't know now. Maybe later.

Pluck a fragment out of an array.

Josh wants to update one value at a time in place instead of rewriting the entire blob. Mentioned doing this by hacking TOAST, but it would break transactions. Both ondisk storage and in-memory representation are issues. Maybe manip palloc. Oracle's nested tables also mentioned.

Distinguishing between binary representation and text representation. pg_upgrade would have to scan the whole table. We'd need a different page number. Users would need to run the check option first. Bruce doesn't want pgupgrade to modify the old cluster. We'd need a separate cleanup program.

There was a discussion about deprecating the code which upgrades hstore1 (the 8.3 version) to hstore2 (the 9.0 version). Teodor doesn't want to support this anymore. Bruce pointed out that we can't deal with that in pgupgrade.

More discussion about JSON upgradability.

We need some addtional functions for the new JSON:

  • akeys
  • slices

etc. David Wheeler has list.

So we need to support all of these using JSON.

Alvaro asked for the ability to do multi-update. That is update all items which match a path.