Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to create a PostgreSQL database in
AlloyDB for PostgreSQL. Before you can create a database, you must create a
cluster and its primary instance.
To create a database in an AlloyDB cluster, you connect a psql
client to the cluster's primary instance and then run a PostgreSQL CREATE
DATABASE command.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-12 UTC."],[[["\u003cp\u003eThis guide outlines the process of creating a PostgreSQL database within an AlloyDB cluster.\u003c/p\u003e\n"],["\u003cp\u003eDatabase creation requires connecting a \u003ccode\u003epsql\u003c/code\u003e client to the primary instance of the AlloyDB cluster.\u003c/p\u003e\n"],["\u003cp\u003eYou need specific IAM roles, such as \u003ccode\u003eroles/alloydb.admin\u003c/code\u003e, \u003ccode\u003eroles/owner\u003c/code\u003e, or \u003ccode\u003eroles/editor\u003c/code\u003e, to perform this task.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves executing a \u003ccode\u003eCREATE DATABASE\u003c/code\u003e command at the \u003ccode\u003epsql\u003c/code\u003e prompt, adhering to PostgreSQL naming conventions.\u003c/p\u003e\n"]]],[],null,[]]