postgresai 0.18.0-dev.4 → 0.18.0-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -3
- package/dist/bin/postgres-ai.js +34 -24
- package/dist/sql/03.permissions.sql +4 -8
- package/package.json +1 -1
- package/sql/03.permissions.sql +4 -8
package/README.md
CHANGED
|
@@ -208,6 +208,29 @@ machine instead. When stdout is not a terminal the result is JSON with `status`,
|
|
|
208
208
|
`dashboard_url` and `next`. Then: `pgai mon instances list`, `pgai mon instances watch <id-or-name>`, `pgai mon instances delete <id-or-name>`,
|
|
209
209
|
and `pgai mon instances set <id-or-name> --vcpus <n>` to add or change the database server's vCPUs later (an org admin; AAS starts within a minute).
|
|
210
210
|
|
|
211
|
+
To use a direct PostgreSQL connection, explicitly select `--provider generic`:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
pgai mon deploy "$DATABASE_URL" --provider generic --org <alias> --json --no-wait
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
This is the existing `--provider self-managed` path under a clearer name; both spellings work,
|
|
218
|
+
and the result's `provider` remains `self-managed` for compatibility. It works with any reachable
|
|
219
|
+
PostgreSQL endpoint where the supplied user can create the monitoring role and grant privileges.
|
|
220
|
+
Use a direct endpoint, not a pooler.
|
|
221
|
+
|
|
222
|
+
The endpoint must be reachable from this machine, which prepares the database, and from
|
|
223
|
+
PostgresAI. Before provisioning, PostgresAI tests the connection from its platform, whose
|
|
224
|
+
address is not published, so the port must accept connections from the internet at that point.
|
|
225
|
+
After provisioning, the monitoring server connects from its own IP address, shown on its page in
|
|
226
|
+
the Console (Monitoring, then the instance). A database that must stay behind an IP allowlist
|
|
227
|
+
needs AWS PrivateLink (RDS) or self-hosted monitoring (`--self-hosted`).
|
|
228
|
+
|
|
229
|
+
Without `--provider`, RDS and Supabase hostnames still go to their console integration.
|
|
230
|
+
`generic` does not configure AWS PrivateLink, open a firewall, or remove TLS, permission, or
|
|
231
|
+
payment checks. A private endpoint needs a network path, or monitoring hosted in that network
|
|
232
|
+
(`--self-hosted`).
|
|
233
|
+
|
|
211
234
|
`pgai mon deploy` and `pgai dblab deploy` share their options and results: the database URL as the
|
|
212
235
|
argument (or `--db-url`), `--name` (default: from the database), `--location` (a Hetzner location;
|
|
213
236
|
default: any with capacity), `--wait <minutes>` / `--no-wait`, `--yes` (never prompt), `--json`, the
|
|
@@ -229,7 +252,7 @@ terminal, or with `--json`, it only points to `pgai mon deploy`.
|
|
|
229
252
|
|
|
230
253
|
| Option | |
|
|
231
254
|
|---|---|
|
|
232
|
-
| `--provider <provider>` | `clickhouse`, `rds
|
|
255
|
+
| `--provider <provider>` | `generic` (direct PostgreSQL; `self-managed` remains an alias), `clickhouse`, `rds` or `supabase`; default: detected from the host |
|
|
233
256
|
| `--clickhouse-key <key-id>:<key-secret>` | ClickHouse Cloud API key, for CPU, memory and disk |
|
|
234
257
|
| `--self-hosted` | run the stack on this machine (`mon local-install`) instead of PostgresAI Cloud |
|
|
235
258
|
| `--reset-password` | `postgres_ai_mon` exists and its password is lost: set a new one (see below) |
|
|
@@ -404,8 +427,9 @@ PGPASSWORD=<password> pgai dblab deploy 'postgresql://<user>@<host>:5432/<db>' -
|
|
|
404
427
|
```
|
|
405
428
|
|
|
406
429
|
The same options as `pgai mon deploy` (`--db-url`, `--name`, `--location`, `--wait`, `--no-wait`, `--yes`, `--json`),
|
|
407
|
-
plus `--size S|M|L` (default `S`), `--disk <GiB>` (default 50)
|
|
408
|
-
SSH keys, for reaching the server and its clones)
|
|
430
|
+
plus `--size S|M|L` (default `S`), `--disk <GiB>` (default 50), `--ssh-key` (required: one of the organization's
|
|
431
|
+
SSH keys, for reaching the server and its clones) and `--provider generic|rds|supabase` (default: detected; `self-managed`
|
|
432
|
+
remains an alias of `generic`). `--name` defaults to the database's name; `--wait` to 120 minutes.
|
|
409
433
|
It shows the estimated monthly cost before asking; with no payment method it stops with the billing page (exit 3).
|
|
410
434
|
`pgai dblab instances list | watch (status) | delete` take an id or a name.
|
|
411
435
|
|
package/dist/bin/postgres-ai.js
CHANGED
|
@@ -13533,7 +13533,7 @@ var {
|
|
|
13533
13533
|
// package.json
|
|
13534
13534
|
var package_default = {
|
|
13535
13535
|
name: "postgresai",
|
|
13536
|
-
version: "0.18.0-dev.
|
|
13536
|
+
version: "0.18.0-dev.6",
|
|
13537
13537
|
description: "postgres_ai CLI",
|
|
13538
13538
|
license: "Apache-2.0",
|
|
13539
13539
|
private: false,
|
|
@@ -16893,7 +16893,7 @@ var Result = import_lib.default.Result;
|
|
|
16893
16893
|
var TypeOverrides = import_lib.default.TypeOverrides;
|
|
16894
16894
|
var defaults = import_lib.default.defaults;
|
|
16895
16895
|
// package.json
|
|
16896
|
-
var version = "0.18.0-dev.
|
|
16896
|
+
var version = "0.18.0-dev.6";
|
|
16897
16897
|
var package_default2 = {
|
|
16898
16898
|
name: "postgresai",
|
|
16899
16899
|
version,
|
|
@@ -28229,9 +28229,13 @@ function priceText(q) {
|
|
|
28229
28229
|
}
|
|
28230
28230
|
return base;
|
|
28231
28231
|
}
|
|
28232
|
-
var FIRST_CHECKUP_DELAY_MS =
|
|
28232
|
+
var FIRST_CHECKUP_DELAY_MS = 30 * 60000;
|
|
28233
28233
|
var POLL_MS = 15000;
|
|
28234
28234
|
var PROVIDERS = ["clickhouse", "rds", "supabase", "self-managed"];
|
|
28235
|
+
var providerArg = (provider) => {
|
|
28236
|
+
const p = provider?.trim().toLowerCase();
|
|
28237
|
+
return p === "generic" ? "self-managed" : p;
|
|
28238
|
+
};
|
|
28235
28239
|
function parseUrl(url) {
|
|
28236
28240
|
try {
|
|
28237
28241
|
return new URL(url);
|
|
@@ -28444,9 +28448,9 @@ async function billingFor(q, name, opts, deps, show) {
|
|
|
28444
28448
|
async function connect(url, opts, deps) {
|
|
28445
28449
|
const started = deps.now();
|
|
28446
28450
|
const progress = (event, message, more = {}) => deps.progress({ event, elapsed_s: Math.round((deps.now() - started) / 1000), message, ...more });
|
|
28447
|
-
const provider = opts.provider ?? detectCloudProvider(url);
|
|
28451
|
+
const provider = providerArg(opts.provider) ?? detectCloudProvider(url);
|
|
28448
28452
|
if (!PROVIDERS.includes(provider))
|
|
28449
|
-
throw new Error(`--provider must be one of: ${PROVIDERS.join(", ")}`);
|
|
28453
|
+
throw new Error(`--provider must be one of: generic, ${PROVIDERS.join(", ")}`);
|
|
28450
28454
|
assertEncodedUserinfo(url);
|
|
28451
28455
|
checkUrlParams(url, opts.agent);
|
|
28452
28456
|
const name = databaseName2(url);
|
|
@@ -36296,7 +36300,7 @@ async function startMcpServer(rootOpts, extra) {
|
|
|
36296
36300
|
properties: {
|
|
36297
36301
|
...ORG_ID_TOOL_PROPERTY,
|
|
36298
36302
|
database_url: { type: "string", description: "postgresql:// URL with the password in it (admin, or the postgres_ai_mon role)" },
|
|
36299
|
-
provider: { type: "string", description: "clickhouse | rds | supabase
|
|
36303
|
+
provider: { type: "string", description: "generic (direct PostgreSQL URL; alias: self-managed) | clickhouse | rds | supabase (default: detected from the host)" },
|
|
36300
36304
|
clickhouse_key: { type: "string", description: "ClickHouse Cloud API key as <key-id>:<key-secret> (Basic Service API Reader), for CPU, memory and disk" },
|
|
36301
36305
|
yes: { type: "boolean", description: "Accept the price of a billed box. Without it, a billed box is not provisioned: the result has status action_required and the price; ask the user, then call again with yes: true" },
|
|
36302
36306
|
coupon: { type: "string", description: "Stripe promotion code for the organization's monitoring subscription (applies when it is first created)" },
|
|
@@ -37228,9 +37232,13 @@ function priceText2(q) {
|
|
|
37228
37232
|
}
|
|
37229
37233
|
return base;
|
|
37230
37234
|
}
|
|
37231
|
-
var FIRST_CHECKUP_DELAY_MS2 =
|
|
37235
|
+
var FIRST_CHECKUP_DELAY_MS2 = 30 * 60000;
|
|
37232
37236
|
var POLL_MS2 = 15000;
|
|
37233
37237
|
var PROVIDERS2 = ["clickhouse", "rds", "supabase", "self-managed"];
|
|
37238
|
+
var providerArg2 = (provider) => {
|
|
37239
|
+
const p = provider?.trim().toLowerCase();
|
|
37240
|
+
return p === "generic" ? "self-managed" : p;
|
|
37241
|
+
};
|
|
37234
37242
|
function parseUrl2(url) {
|
|
37235
37243
|
try {
|
|
37236
37244
|
return new URL(url);
|
|
@@ -37503,9 +37511,9 @@ async function billingFor2(q, name, opts, deps, show) {
|
|
|
37503
37511
|
async function connect2(url, opts, deps) {
|
|
37504
37512
|
const started = deps.now();
|
|
37505
37513
|
const progress = (event, message, more = {}) => deps.progress({ event, elapsed_s: Math.round((deps.now() - started) / 1000), message, ...more });
|
|
37506
|
-
const provider = opts.provider ?? detectCloudProvider2(url);
|
|
37514
|
+
const provider = providerArg2(opts.provider) ?? detectCloudProvider2(url);
|
|
37507
37515
|
if (!PROVIDERS2.includes(provider))
|
|
37508
|
-
throw new Error(`--provider must be one of: ${PROVIDERS2.join(", ")}`);
|
|
37516
|
+
throw new Error(`--provider must be one of: generic, ${PROVIDERS2.join(", ")}`);
|
|
37509
37517
|
assertEncodedUserinfo(url);
|
|
37510
37518
|
checkUrlParams2(url, opts.agent);
|
|
37511
37519
|
const name = databaseName3(url);
|
|
@@ -39025,7 +39033,7 @@ function withEnvPassword(dbUrl, env = process.env) {
|
|
|
39025
39033
|
u.password = encodeURIComponent(pw);
|
|
39026
39034
|
return u.toString();
|
|
39027
39035
|
}
|
|
39028
|
-
var DBLAB_PROVIDERS = ["rds", "supabase", "self-managed"];
|
|
39036
|
+
var DBLAB_PROVIDERS = ["generic", "rds", "supabase", "self-managed"];
|
|
39029
39037
|
var DBLAB_CLOUDS = ["hetzner", "aws", "gcp"];
|
|
39030
39038
|
var CLOUD_NAMES = { hetzner: "Hetzner", aws: "AWS", gcp: "Google Cloud" };
|
|
39031
39039
|
var cloudName = (cloud) => CLOUD_NAMES[cloud ?? "hetzner"] ?? String(cloud);
|
|
@@ -39460,7 +39468,7 @@ function failureSummary(error) {
|
|
|
39460
39468
|
}
|
|
39461
39469
|
function registerDblabDeployCommands(dblab, deps) {
|
|
39462
39470
|
const tty = deps.isTty ?? isTtyDefault;
|
|
39463
|
-
sharedDeployOptions(deps.withOrgOptions(dblab.command("deploy")), 120, "instance name: lowercase letters, digits, hyphens (default: from the database's name)", "Hetzner location: fsn1, nbg1 or hel1 (default: any with capacity); with --cloud aws or gcp, a region " + "(default: the source's region, else us-east-1 / us-central1)").description("deploy DBLab + Joe in PostgresAI cloud, then follow it until it is ready").option("--size <size>", "server size (S, M, L)", "S").option("--disk <gib>", "disk size in GiB", "50").option("--ssh-key <name|id...>", "org SSH key(s) for reaching the server and its clones (required)").option("--provider <provider>", "where the database runs:
|
|
39471
|
+
sharedDeployOptions(deps.withOrgOptions(dblab.command("deploy")), 120, "instance name: lowercase letters, digits, hyphens (default: from the database's name)", "Hetzner location: fsn1, nbg1 or hel1 (default: any with capacity); with --cloud aws or gcp, a region " + "(default: the source's region, else us-east-1 / us-central1)").description("deploy DBLab + Joe in PostgresAI cloud, then follow it until it is ready").option("--size <size>", "server size (S, M, L)", "S").option("--disk <gib>", "disk size in GiB", "50").option("--ssh-key <name|id...>", "org SSH key(s) for reaching the server and its clones (required)").option("--provider <provider>", "where the database runs: generic (direct PostgreSQL URL; alias: self-managed), rds or supabase (default: detected)").option("--cloud <cloud>", "where the DBLab server runs: hetzner, aws or gcp (default: hetzner); --location is then its region").addHelpText("after", [
|
|
39464
39472
|
"",
|
|
39465
39473
|
"The password: in the URL, or set PGPASSWORD.",
|
|
39466
39474
|
"A Supabase project without its password: deploy it from the Console (Connect Supabase).",
|
|
@@ -40678,8 +40686,10 @@ function detectProvider(conn) {
|
|
|
40678
40686
|
}
|
|
40679
40687
|
}
|
|
40680
40688
|
function resolveProvider(explicit, conn) {
|
|
40681
|
-
if (explicit !== undefined)
|
|
40682
|
-
|
|
40689
|
+
if (explicit !== undefined) {
|
|
40690
|
+
const p = explicit.trim().toLowerCase();
|
|
40691
|
+
return { provider: p === "generic" ? "self-managed" : p, detected: false };
|
|
40692
|
+
}
|
|
40683
40693
|
const provider = conn === undefined ? null : detectProvider(conn);
|
|
40684
40694
|
return { provider: provider ?? "self-managed", detected: provider !== null };
|
|
40685
40695
|
}
|
|
@@ -46485,7 +46495,7 @@ program2.command("set-storage-url <url>").description("store storage base URL fo
|
|
|
46485
46495
|
process.exitCode = 1;
|
|
46486
46496
|
}
|
|
46487
46497
|
});
|
|
46488
|
-
program2.command("prepare-db [conn]").description("prepare database for monitoring: create monitoring user, required view(s), and grant permissions (idempotent)").option("--db-url <url>", "PostgreSQL connection URL (admin) to run the setup against (deprecated; pass it as positional arg, or PGAI_DB_URL)").option("-h, --host <host>", "PostgreSQL host (psql-like)").option("-p, --port <port>", "PostgreSQL port (psql-like)").option("-U, --username <username>", "PostgreSQL user (psql-like)").option("-d, --dbname <dbname>", "PostgreSQL database name (psql-like)").option("--admin-password <password>", "Admin connection password (otherwise uses PGPASSWORD if set)").option("--monitoring-user <name>", "Monitoring role name to create/update", DEFAULT_MONITORING_USER2).option("--password <password>", "Monitoring role password (overrides PGAI_MON_PASSWORD)").option("--skip-optional-permissions", "Skip optional permissions (RDS/self-managed extras)", false).option("--provider <provider>", "Database provider (
|
|
46498
|
+
program2.command("prepare-db [conn]").description("prepare database for monitoring: create monitoring user, required view(s), and grant permissions (idempotent)").option("--db-url <url>", "PostgreSQL connection URL (admin) to run the setup against (deprecated; pass it as positional arg, or PGAI_DB_URL)").option("-h, --host <host>", "PostgreSQL host (psql-like)").option("-p, --port <port>", "PostgreSQL port (psql-like)").option("-U, --username <username>", "PostgreSQL user (psql-like)").option("-d, --dbname <dbname>", "PostgreSQL database name (psql-like)").option("--admin-password <password>", "Admin connection password (otherwise uses PGPASSWORD if set)").option("--monitoring-user <name>", "Monitoring role name to create/update", DEFAULT_MONITORING_USER2).option("--password <password>", "Monitoring role password (overrides PGAI_MON_PASSWORD)").option("--skip-optional-permissions", "Skip optional permissions (RDS/self-managed extras)", false).option("--provider <provider>", "Database provider: generic (alias: self-managed), supabase or clickhouse. Affects which steps are executed.").option("--verify", "Verify that monitoring role/permissions are in place (no changes)", false).option("--reset-password", "Reset monitoring role password only (no other changes)", false).option("--print-sql", "Print SQL plan and exit (no changes applied)", false).option("--print-password", "Print generated monitoring password (DANGEROUS in CI logs)", false).option("--supabase", "Use Supabase Management API instead of direct PostgreSQL connection", false).option("--supabase-access-token <token>", "Supabase Management API access token (or SUPABASE_ACCESS_TOKEN env)").option("--supabase-project-ref <ref>", "Supabase project reference (or SUPABASE_PROJECT_REF env)").option("--json", "Output result as JSON (machine-readable)", false).addHelpText("after", [
|
|
46489
46499
|
"",
|
|
46490
46500
|
"Examples:",
|
|
46491
46501
|
" postgresai prepare-db postgresql://admin@host:5432/dbname",
|
|
@@ -47177,7 +47187,7 @@ program2.command("prepare-db [conn]").description("prepare database for monitori
|
|
|
47177
47187
|
}
|
|
47178
47188
|
}
|
|
47179
47189
|
});
|
|
47180
|
-
program2.command("unprepare-db [conn]").description("remove monitoring setup: drop monitoring user, views, schema, and revoke permissions").option("--db-url <url>", "PostgreSQL connection URL (admin) (deprecated; pass it as positional arg)").option("-h, --host <host>", "PostgreSQL host (psql-like)").option("-p, --port <port>", "PostgreSQL port (psql-like)").option("-U, --username <username>", "PostgreSQL user (psql-like)").option("-d, --dbname <dbname>", "PostgreSQL database name (psql-like)").option("--admin-password <password>", "Admin connection password (otherwise uses PGPASSWORD if set)").option("--monitoring-user <name>", "Monitoring role name to remove", DEFAULT_MONITORING_USER2).option("--keep-role", "Keep the monitoring role (only revoke permissions and drop objects)", false).option("--provider <provider>", "Database provider (
|
|
47190
|
+
program2.command("unprepare-db [conn]").description("remove monitoring setup: drop monitoring user, views, schema, and revoke permissions").option("--db-url <url>", "PostgreSQL connection URL (admin) (deprecated; pass it as positional arg)").option("-h, --host <host>", "PostgreSQL host (psql-like)").option("-p, --port <port>", "PostgreSQL port (psql-like)").option("-U, --username <username>", "PostgreSQL user (psql-like)").option("-d, --dbname <dbname>", "PostgreSQL database name (psql-like)").option("--admin-password <password>", "Admin connection password (otherwise uses PGPASSWORD if set)").option("--monitoring-user <name>", "Monitoring role name to remove", DEFAULT_MONITORING_USER2).option("--keep-role", "Keep the monitoring role (only revoke permissions and drop objects)", false).option("--provider <provider>", "Database provider: generic (alias: self-managed), supabase or clickhouse. Affects which steps are executed.").option("--print-sql", "Print SQL plan and exit (no changes applied)", false).option("--force", "Skip confirmation prompt", false).option("--json", "Output result as JSON (machine-readable)", false).addHelpText("after", [
|
|
47181
47191
|
"",
|
|
47182
47192
|
"Examples:",
|
|
47183
47193
|
" postgresai unprepare-db postgresql://admin@host:5432/dbname",
|
|
@@ -48033,13 +48043,7 @@ async function applyMonitoringTargetsConfig() {
|
|
|
48033
48043
|
if (generateCode !== 0)
|
|
48034
48044
|
return generateCode;
|
|
48035
48045
|
console.log("Restarting pgwatch collectors to pick up target changes...");
|
|
48036
|
-
|
|
48037
|
-
if (upCode !== 0)
|
|
48038
|
-
return upCode;
|
|
48039
|
-
if (await runCompose(["restart", "postgres-reports"]) !== 0) {
|
|
48040
|
-
console.error("\u26A0 Could not restart postgres-reports; the target's first report comes with its next daily run");
|
|
48041
|
-
}
|
|
48042
|
-
return 0;
|
|
48046
|
+
return runCompose(["up", "-d", "--force-recreate", "pgwatch-prometheus", "pgwatch-postgres"]);
|
|
48043
48047
|
}
|
|
48044
48048
|
async function runCompose(args, grafanaPassword, extraEnv) {
|
|
48045
48049
|
let composeFile;
|
|
@@ -48344,7 +48348,8 @@ async function runConnect(urlArg, opts) {
|
|
|
48344
48348
|
if (!name || !/^postgres(ql)?:\/\//.test(url)) {
|
|
48345
48349
|
return emitConnect({ status: "failed", provider: "self-managed", name, next: "Pass a URL: pgai mon deploy postgresql://user:password@host:5432/dbname" }, opts.json);
|
|
48346
48350
|
}
|
|
48347
|
-
const
|
|
48351
|
+
const explicit = providerArg2(opts.provider);
|
|
48352
|
+
const provider = PROVIDERS2.find((p) => p === explicit) ?? detectCloudProvider2(url);
|
|
48348
48353
|
let minutes;
|
|
48349
48354
|
try {
|
|
48350
48355
|
minutes = waitMinutes2(opts.wait, 20);
|
|
@@ -48472,13 +48477,18 @@ Cancelling: nothing has been created yet (Ctrl-C again to quit now).`);
|
|
|
48472
48477
|
}
|
|
48473
48478
|
}
|
|
48474
48479
|
var mon = program2.command("mon").description("monitoring services management");
|
|
48475
|
-
sharedDeployOptions2(withOrgOptions(mon.command("deploy")), 20, "instance name (default: host[:port]/database)").description("deploy PostgresAI Cloud monitoring for a database: prepare it, provision the monitoring box, print its Health Matrix and dashboard").option("--provider <provider>", "clickhouse | rds | supabase
|
|
48480
|
+
sharedDeployOptions2(withOrgOptions(mon.command("deploy")), 20, "instance name (default: host[:port]/database)").description("deploy PostgresAI Cloud monitoring for a database: prepare it, provision the monitoring box, print its Health Matrix and dashboard").option("--provider <provider>", "generic (direct PostgreSQL URL; alias: self-managed) | clickhouse | rds | supabase (default: detected from the host)").option("--clickhouse-key <id:secret>", "ClickHouse Cloud API key (Basic Service API Reader) for CPU, memory and disk; or CLICKHOUSE_KEY_ID + CLICKHOUSE_KEY_SECRET").option("--self-hosted", "run the monitoring stack on this machine (mon local-install) instead of PostgresAI Cloud").option("--reset-password", "postgres_ai_mon exists and its password is lost: set a new one (admin URL; refused while another database on the server is monitored)").option("--coupon <code>", "promotion code for the organization's monitoring subscription (applies when it is first created)").option("--vcpus <n>", "vCPUs of the database server; without it there is no AAS (database load) data (asked at a terminal)").addHelpText("after", [
|
|
48476
48481
|
"",
|
|
48477
48482
|
"Steps (each skipped when already done; safe to re-run): sign in, prepare the database",
|
|
48478
48483
|
"(an admin URL creates the postgres_ai_mon role; otherwise the SQL is printed), provision",
|
|
48479
48484
|
"the monitoring box, run the express checkup while it starts, wait, print the Health Matrix",
|
|
48480
48485
|
"(health_url) and Grafana, signed in with your PostgresAI account (dashboard_url).",
|
|
48481
48486
|
"",
|
|
48487
|
+
"Network: the database must be reachable from this machine and from PostgresAI. Before provisioning,",
|
|
48488
|
+
"PostgresAI tests the connection from an unpublished address, so the port must accept connections",
|
|
48489
|
+
"from the internet; after it, the monitoring box connects from the IP shown on its Console page.",
|
|
48490
|
+
"Behind an IP allowlist, use AWS PrivateLink (RDS) or --self-hosted.",
|
|
48491
|
+
"",
|
|
48482
48492
|
"Billing is per Postgres cluster observed: another database in a cluster the organization already",
|
|
48483
48493
|
'monitors is included. Once the URL is checked, deploy shows the price (or "free (N of M free slots)"). A billed',
|
|
48484
48494
|
"box is provisioned only when accepted: at the prompt, or with --yes. With no payment method",
|
|
@@ -7,14 +7,10 @@ grant connect on database {{DB_IDENT}} to {{ROLE_IDENT}};
|
|
|
7
7
|
grant pg_monitor to {{ROLE_IDENT}};
|
|
8
8
|
grant select on pg_catalog.pg_index to {{ROLE_IDENT}};
|
|
9
9
|
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--
|
|
13
|
-
--
|
|
14
|
-
-- in the pg_stat_statements metric. pg_monitor already implies pg_read_all_stats;
|
|
15
|
-
-- granting it explicitly documents the dependency and keeps the metric working if the
|
|
16
|
-
-- pg_monitor grant above is ever narrowed. Idempotent.
|
|
17
|
-
grant pg_read_all_stats to {{ROLE_IDENT}};
|
|
10
|
+
-- Cluster-wide pg_stat_statements collection needs pg_read_all_stats (without it, other
|
|
11
|
+
-- users' rows have queryid and query text redacted to NULL). pg_monitor includes it, so it
|
|
12
|
+
-- is not granted directly: on PostgreSQL 16+ that needs ADMIN OPTION on pg_read_all_stats,
|
|
13
|
+
-- which Supabase's `postgres` role does not have (it has ADMIN OPTION on pg_monitor only).
|
|
18
14
|
|
|
19
15
|
-- Create postgres_ai schema for our objects
|
|
20
16
|
-- Using IF NOT EXISTS for idempotency - prepare-db can be run multiple times
|
package/package.json
CHANGED
package/sql/03.permissions.sql
CHANGED
|
@@ -7,14 +7,10 @@ grant connect on database {{DB_IDENT}} to {{ROLE_IDENT}};
|
|
|
7
7
|
grant pg_monitor to {{ROLE_IDENT}};
|
|
8
8
|
grant select on pg_catalog.pg_index to {{ROLE_IDENT}};
|
|
9
9
|
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--
|
|
13
|
-
--
|
|
14
|
-
-- in the pg_stat_statements metric. pg_monitor already implies pg_read_all_stats;
|
|
15
|
-
-- granting it explicitly documents the dependency and keeps the metric working if the
|
|
16
|
-
-- pg_monitor grant above is ever narrowed. Idempotent.
|
|
17
|
-
grant pg_read_all_stats to {{ROLE_IDENT}};
|
|
10
|
+
-- Cluster-wide pg_stat_statements collection needs pg_read_all_stats (without it, other
|
|
11
|
+
-- users' rows have queryid and query text redacted to NULL). pg_monitor includes it, so it
|
|
12
|
+
-- is not granted directly: on PostgreSQL 16+ that needs ADMIN OPTION on pg_read_all_stats,
|
|
13
|
+
-- which Supabase's `postgres` role does not have (it has ADMIN OPTION on pg_monitor only).
|
|
18
14
|
|
|
19
15
|
-- Create postgres_ai schema for our objects
|
|
20
16
|
-- Using IF NOT EXISTS for idempotency - prepare-db can be run multiple times
|