---
layout: article
title: Quick start
description: Create your first native PostgreSQL database in the Appwrite Console, run your first queries in the SQL editor, and connect with psql.
---

You can create a PostgreSQL database and run your first query in a few minutes.

# Create a database

**Available regions**

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.

1. In your project, go to **Databases**.
2. Click **Create database**.
3. Under **Choose database type**, select **PostgreSQL** from the **Native databases** group.
4. Give your database a name, and optionally a custom database ID. This step appears once you pick a type.

![Create database type selection](/images/docs/products/databases/postgresql/create-database-type.avif)

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

![Database specifications](/images/docs/products/databases/postgresql/create-database-specs.avif)

7. 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

![SQL editor](/images/docs/products/databases/postgresql/sql-editor-run.avif)

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:

```sql
CREATE TABLE books (
    id SERIAL PRIMARY KEY,
    title TEXT NOT NULL,
    author TEXT NOT NULL
);
```

Insert a row:

```sql
INSERT INTO books (title, author)
VALUES ('The Hitchhiker''s Guide to the Galaxy', 'Douglas Adams');
```

Read it back:

```sql
SELECT * FROM books;
```

# Get your connection details

To connect from outside the Console:

1. Open your database and click **Credentials**.
2. The **Details** tab shows the host, port, username, password, and database name.
3. 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:

```bash
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](/docs/products/databases/postgresql/connections) for driver examples.

# Next steps

- [Connections](/docs/products/databases/postgresql/connections): Connect from your application with any PostgreSQL driver or ORM.
- [Extensions](/docs/products/databases/postgresql/extensions): Install PostgreSQL extensions like PostGIS and pgvector.
- [Backups](/docs/products/databases/postgresql/backups): Configure backup policies and point-in-time recovery.
- [Monitoring](/docs/products/databases/postgresql/monitoring): Watch compute, connections, storage, and workload metrics live.
