You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: POSTGRESQL.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,3 +28,26 @@ This section covers connecting to a PostgreSQL database instance.
28
28
likely that the user do not have the correct privileges on the PostgreSQL
29
29
database. Database-level permissions (e.g., `SELECT`, `INSERT`) are required
30
30
to execute queries.
31
+
32
+
---
33
+
34
+
# Usage Guidelines
35
+
36
+
## Reusing Project Values
37
+
38
+
Users may have set project environment variables:
39
+
40
+
*`POSTGRES_HOST`: The hostname or IP address of the PostgreSQL server.
41
+
*`POSTGRES_PORT`: The port number of the PostgreSQL server.
42
+
*`POSTGRES_DATABASE`: The name of the database to connect to.
43
+
*`POSTGRES_USER`: The username for authentication.
44
+
*`POSTGRES_PASSWORD`: The password for authentication.
45
+
46
+
Instead of prompting the user for these values for specific tool calls, prompt the user to verify reuse a specific value.
47
+
Make sure to not use the environment variable name like `POSTGRES_HOST`, `${POSTGRES_HOST}`, or `$POSTGRES_HOST`. The value can be found by using command: `echo $POSTGRES_HOST`.
48
+
49
+
## Use Full Table Name Format "DATABASE_NAME.SCHEMA_NAME.TABLE_NAME"
50
+
51
+
**ALWAYS** use the full table name format, `DATABASE_NAME.SCHEMA_NAME.TABLE_NAME` in the generated SQL when using the `execute_sql` or `postgres__execute_sql` tool.
52
+
* Default to using "public" for the schema name.
53
+
* Use command `echo $POSTGRES_DATABASE` to get the current database value.
0 commit comments