CloudWiki
Resource
Get a free AWS Well-Architected Assessment ->

Microsoft Azure

PostgreSQL

Azure Database for PostgreSQL is a fully managed relational database service for PostgreSQL databases. It is built on top of the community edition of the PostgreSQL database, and provides enterprise-grade features and capabilities, including high availability, automatic backups, and security. With Azure Database for PostgreSQL, users can easily deploy, scale, and manage PostgreSQL databases on Azure without worrying about infrastructure management tasks. It supports various PostgreSQL extensions, including PostGIS, PL/Python, and PL/Java, and allows users to run their PostgreSQL workloads on a highly available and secure platform. Azure Database for PostgreSQL provides several deployment options, including single server and Hyperscale (Citus) deployments. The Hyperscale (Citus) option provides horizontal scaling for high-performance workloads, allowing users to scale out their PostgreSQL databases across multiple nodes for increased query performance. Azure Database for PostgreSQL is ideal for organizations looking to migrate their existing PostgreSQL workloads to the cloud, or for new applications that require a fully managed PostgreSQL database service with enterprise-grade features and capabilities.‍
aws cost
Costs
Direct Cost
Indirect Cost
No items found.
Terraform Name
terraform
azurerm_postgresql_database
PostgreSQL
attributes:

The following arguments are supported:

  • name - (Required) Specifies the name of the PostgreSQL Database, which needs to be a valid PostgreSQL identifier. Changing this forces a new resource to be created.
  • server_name - (Required) Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.
  • resource_group_name - (Required) The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created.
  • charset - (Required) Specifies the Charset for the PostgreSQL Database, which needs to be a valid PostgreSQL Charset. Changing this forces a new resource to be created.
  • collation - (Required) Specifies the Collation for the PostgreSQL Database, which needs to be a valid PostgreSQL Collation. Note that Microsoft uses different notation - en-US instead of en_US. Changing this forces a new resource to be created.

Associating resources with a
PostgreSQL
Resources do not "belong" to a
PostgreSQL
Rather, one or more Security Groups are associated to a resource.
Create
PostgreSQL
via Terraform:
The following HCL manages a PostgreSQL Database within a PostgreSQL Server
Syntax:

resource "azurerm_resource_group" "example" {
 name     = "api-rg-pro"
 location = "West Europe"
}

resource "azurerm_postgresql_server" "example" {
 name                = "postgresql-server-1"
 location            = azurerm_resource_group.example.location
 resource_group_name = azurerm_resource_group.example.name

 sku_name = "B_Gen5_2"

 storage_mb                   = 5120
 backup_retention_days        = 7
 geo_redundant_backup_enabled = false
 auto_grow_enabled            = true

 administrator_login          = "psqladmin"
 administrator_login_password = "H@Sh1CoR3!"
 version                      = "9.5"
 ssl_enforcement_enabled      = true
}

resource "azurerm_postgresql_database" "example" {
 name                = "exampledb"
 resource_group_name = azurerm_resource_group.example.name
 server_name         = azurerm_postgresql_server.example.name
 charset             = "UTF8"
 collation           = "English_United States.1252"
}

Create
PostgreSQL
via CLI:
Parametres:

az postgres db create --name
                     --resource-group
                     --server-name
                     [--charset]
                     [--collation]

Example:

az postgres db create -g testgroup -s testsvr -n testdb

Best Practices for
PostgreSQL

Categorized by Availability, Security & Compliance and Cost

No items found.
Explore all the rules our platform covers
Related blog posts