Quick start_
Create your first native PostgreSQL database in the Appwrite Console, run your first queries in the SQL editor, and connect with psql.
2 min read
You can create a PostgreSQL database and run your first query in a few minutes.
Create a database
Native databases are rolling out region by region, starting with Frankfurt (fra) and New York (nyc), and more regions are on the way. A database takes the region of the project that owns it and there is no per-database region selector, so create your project in a supported region before you start.
- In your project, go to Databases.
- Click Create database.
- Under Choose database type, select PostgreSQL from the Native databases group.
- Give your database a name, and optionally a custom database ID. This step appears once you pick a type.

- Under Specifications, select your preferred tier.
- Optionally configure Read replicas and Point-in-time recovery (PITR). You can change both later.

- Review the database summary and click Create database.
Your database starts provisioning and becomes ready shortly after. You land in the SQL editor once it is created.
Run your first queries

The SQL editor tab gives you an editor with formatting, query explain, and a results panel, without leaving the browser.
The editor runs one statement per query, so run these three in turn rather than pasting them together.
Create a table:
CREATE TABLE books ( id SERIAL PRIMARY KEY, title TEXT NOT NULL, author TEXT NOT NULL);Insert a row:
INSERT INTO books (title, author)VALUES ('The Hitchhiker''s Guide to the Galaxy', 'Douglas Adams');Read it back:
SELECT * FROM books;Get your connection details
To connect from outside the Console:
- Open your database and click Credentials.
- The Details tab shows the host, port, username, password, and database name.
- The DSN, .env, Prisma, Drizzle, and psql tabs have ready-made snippets for each workflow.
Connect with psql
Copy the command from the psql tab of the credentials dialog, or build it from the details. The port shown there is 6432, the connection pooler, which is what you want for everyday use:
PGSSLMODE=require psql -h <host> -p 6432 -U admin -d <database>Port 5432 reaches the database directly, bypassing the pooler. Use it for migrations and other work that needs one session for the whole run.
Enter the password when prompted. You can run the same queries from your terminal that you ran in the SQL editor, or connect from your application with any PostgreSQL driver. See Connections for driver examples.
Next steps
Was this page helpful?
Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.