
Otherwise, copy the Service URI, as highlighted, and use the tool of your choice. If the chosen tool is psql, we can get the necessary command line, complete with connection details, by clicking on Quick connect. Once the service status is Running we can use our favourite tool to connect. Let's go for pg-jsonb-cheatsheet so we can immediately understand why we created the PostgreSQL instance.Īfter clicking on Create service, we need just a couple minutes of patience for the service to come up.
Service name: used to identify the service uniquely, we can either accept the default or write a more accurate name. For our testing purposes the Hobbyist plan would be enough. Service plan: various options are available, from hobbyist to premium plans, covering all the scenarios from test to highly available production system. Please note that you don't need to create a cloud account with the chosen provider, Aiven will handle everything for you. Feel free to select your favourite cloud provider and the cloud region closer to where you are, this will help minimise the latency. Cloud provider and region: we can deploy our PostgreSQL wherever we want. We can select the newly released Version 15. Service type: the choice is PostgreSQL®, any version is ok. In this walkthrough, we're going to use an Aiven for PostgreSQL database: we can create one,īy accessing the Aiven Console, clicking on Create Service and then filling in the following details: The operators and functions will work with any PostgreSQL database, all the docs have been checked from 9.5+, include both the JSON and JSONB functions. #Postgresql jsonb select example full
The image above is only for display purposes, download the high resolution copy with full copy/paste features.
If you need the JSON functions instead, they're really similar but without the b ending. The first validates that the content is in JSON format and stores it as a string, the second is a binary representation optimised for faster processing and better indexing. PostgreSQL actually has two JSON datatypes, json and jsonb.