Overview

This topic describes how to use the jsonb_set and jsonb functions in an apsaradb RDS for PostgreSQL instance RDS PostgreSQL v9.4.

Detail

Alibaba Cloud reminds you that:

  • Before you perform operations that may cause risks, such as modifying instance configurations or data, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
  • You can modify the configurations and data of instances including but not limited to Elastic Compute Service (ECS) and Relational Database Service (RDS) instances. Before the modification, we recommend that you create snapshots or enable RDS log backup.
  • If you have authorized or submitted security information such as the logon account and password in the Alibaba Cloud Management console, we recommend that you modify such information in a timely manner.
  1. Use a client to connect to the database and run the following command. If the following error occurs, restart the database instance in the console to upgrade to the latest 9.4.
    create extension jsonbx;
    The following command output is returned.
    postgres=> create extension jsonbx;  ERROR: invalid extension name: "jsonbxx" DETAIL: Extension is not supported.
  2. Run the following command to check whether apsaradb RDS for PostgreSQL supports jsonb_set and jsonb:
    jsonb_pretty (in 9.5) jsonb_concat (in 9.5) jsonb_delete(jsonb, text) (in 9.5) jsonb_delete_idx(jsonb, int) (in 9.5) jsonb_delete_path(jsonb, text[]) (in 9.5) jsonb_set(jsonb, text[], jsonb) (in 9.5) concatenation operator (||) (in 9.5) delete key operator (jsonb - text) (in 9.5) delete key by index operator (jsonb - int) (in 9.5) delete key by path operator (jsonb - text[]) (in 9.5)

Application scope

  • Apsaradb for PostgreSQL