Skip to content

Commit c1f5bde

Browse files
committed
improve setup steps
1 parent 35e211f commit c1f5bde

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,35 @@ A complete PostgreSQL monitoring solution with automated performance analysis an
44

55
## 🚀 Quick Start
66

7+
Create a new DB user in database to be monitored (skip this if you want just to check out `postgres_ai` monitoring with a synthetic `demo` database):
8+
```sql
9+
-- Create a user for Postgres AI monitoring
10+
create user postgres_ai_mon with password '<password>';
11+
12+
grant connect on database <database_name> to postgres_ai_mon;
13+
14+
grant pg_monitor to postgres_ai_mon;
15+
grant usage on schema public to postgres_ai_mon;
16+
grant select on all tables in schema public to postgres_ai_mon; -- TEMPORARY; TODO: get rid of this
17+
grant select on all sequences in schema public to postgres_ai_mon;
18+
19+
grant select on pg_stat_statements to postgres_ai_mon;
20+
grant select on pg_stat_database to postgres_ai_mon;
21+
grant select on pg_stat_user_tables to postgres_ai_mon;
22+
```
23+
724
**One command setup:**
825

926
```bash
1027
# Download the CLI
1128
curl -o postgres_ai https://gitlab.com/postgres-ai/postgres_ai/-/raw/main/postgres_ai && chmod +x postgres_ai
29+
```
1230

31+
Now, start it and wait for a few minutes. Two optional adjustments:
32+
- remove `--demo` unless you want to see it in action without monitoring an actual Postgres DB (this option creates a demo DB)
33+
- get an Postgres AI access token for your organization at https://console.postgres.ai (`Your org name → Manage → Access tokens`)
34+
35+
```bash
1336
# Complete setup with demo database
1437
./postgres_ai quickstart --demo
1538

0 commit comments

Comments
 (0)