The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
minor edits after proof reading
Oliver Rice9243b276ab30
diff --git a/apps/docs/pages/guides/database/extensions/http.mdx b/apps/docs/pages/guides/database/extensions/http.mdxindex 11ac8e55d41..7f686ed8e7b 100644--- a/apps/docs/pages/guides/database/extensions/http.mdx+++ b/apps/docs/pages/guides/database/extensions/http.mdx@@ -63,7 +63,7 @@ drop extension if exists http;Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension".To disable an extension, call `drop extension`.-It's good practice to create the extension within a separate schema (like `extensions`) to keep your database clean.+It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean.</TabPanel></Tabs>diff --git a/apps/docs/pages/guides/database/extensions/hypopg.mdx b/apps/docs/pages/guides/database/extensions/hypopg.mdxindex c493f9f89cd..069d530333e 100644--- a/apps/docs/pages/guides/database/extensions/hypopg.mdx+++ b/apps/docs/pages/guides/database/extensions/hypopg.mdx@@ -7,7 +7,8 @@ export const meta = {}`HypoPG` is PostgreSQL extension for creating hypothetical/virtual indexes. HypoPG allows users to rapidly create hypothetical/virtual indexes that have no resource cost (CPU, disk, memory) that are visible to the PostgreSQL query planner.-That allows users to quickly search for an index to improve a slow query without waiting for them to build.++The motivation for HypoPG is to allow users to quickly search for an index to improve a slow query without consuming server resources or waiting for them to build.## Usage@@ -40,14 +41,14 @@ drop extension if exists hypopg;Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension".To disable an extension you can call `drop extension`.-It's good practice to create the extension within a separate schema (like `extensions`) to keep your database clean.+It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean.</TabPanel></Tabs>### Speeding up a query-Given the following table and a simple query to select from the table by id:+Given the following table and a simple query to select from the table by `id`:{/* prettier-ignore */}```sqldiff --git a/apps/docs/pages/guides/database/extensions/pg-safeupdate.mdx b/apps/docs/pages/guides/database/extensions/pg-safeupdate.mdxindex dfa37f4bae9..05ecd7781bd 100644--- a/apps/docs/pages/guides/database/extensions/pg-safeupdate.mdx+++ b/apps/docs/pages/guides/database/extensions/pg-safeupdate.mdx@@ -6,9 +6,9 @@ export const meta = {description: 'Requires a where clause for update and delete',}-[pg-safeupdate](https://github.com/eradman/pg-safeupdate) is PostgreSQL extension is designed to prevent users from accidentally updating or deleting too many records in a single statement by requiring a "where" clause in all update and delete statements.+[pg-safeupdate](https://github.com/eradman/pg-safeupdate) is a PostgreSQL extension designed to prevent users from accidentally updating or deleting too many records in a single statement by requiring a "where" clause in all update and delete statements.-The `pg-safeupdate` extension is a useful tool for protecting data integrity and preventing accidental data loss. Without it, a user could accidentally execute an update or delete statement that affects all records in a table. With pg-safeupdate, users are required to be more deliberate in their update and delete statements, which reduces the risk of significant error.+The `pg-safeupdate` extension is a useful tool for protecting data integrity and preventing accidental data loss. Without it, a user could accidentally execute an update or delete statement that affects all records in a table. With `pg-safeupdate`, users are required to be more deliberate in their update and delete statements, which reduces the risk of significant error.## Enable the extension@@ -28,7 +28,7 @@ alter database some_db set session_preload_libraries = 'safeupdate';## Usage-Let's take a look at an example to see how pg-safeupdate works. Suppose we have a table called "employees" with the following columns: id, name, department, and salary. We want to update the salary for a specific employee with the ID of 12345. Here is what the query would look like without pg-safeupdate:+Let's take a look at an example to see how pg-safeupdate works. Suppose we have a table called `employees` with the following columns: `id`, `name`, `department`, and `date_of_birth`. We want to update the `date_of_birth` for a specific employee with the `id` of 12345. Here is what the query would look like if we forgot to add a "where" clause:{/* prettier-ignore */}```sql@@ -37,20 +37,19 @@ load 'safeupdate';update employees set date_of_birth = '1987-01-28';```-This query updates the `date_of_birth` for all employees to 1987-01-28, which is likely not what we intended. With `pg-safeupdate` enabled, we receive an error message prompting us to add a "where" clause to the query:+This query updates the `date_of_birth` for all employees to 1987-01-28, which is not what we intended. With `pg-safeupdate` enabled, we receive an error message prompting us to add a "where" clause to the query:{/* prettier-ignore */}```sqlERROR: UPDATE requires a WHERE clause```-We would then update our query to include a "where" clause specifying the employee with the ID of 12345:+We would then update our query to include a "where" clause specifying the employee with the `id` of 12345:{/* prettier-ignore */}```sqlupdate employees set date_of_birth = '1987-01-28' where id = 12345;```-This query updates the `date_of_birth` for only the employee with the id of 12345 and succeeds.## Resources@@ -58,4 +57,4 @@ This query updates the `date_of_birth` for only the employee with the id of 1234export const Page = ({ children }) => <Layout meta={meta} children={children} />-export default Page\ No newline at end of file+export default Pagediff --git a/apps/docs/pages/guides/database/extensions/pg_graphql.mdx b/apps/docs/pages/guides/database/extensions/pg_graphql.mdxindex d8b6c3d3397..fefd01ccae4 100644--- a/apps/docs/pages/guides/database/extensions/pg_graphql.mdx+++ b/apps/docs/pages/guides/database/extensions/pg_graphql.mdx@@ -2,21 +2,20 @@ import Layout from '~/layouts/DefaultGuideLayout'export const meta = {id: 'pg_graphql',- title: 'pg_graphql: Native GraphQL for PostgreSQL',- description: 'A GraphQL API for PostgreSQL',+ title: 'pg_graphql: GraphQL for PostgreSQL',+ description: 'A GraphQL Interface for PostgreSQL',}[pg_graphql](https://supabase.github.io/pg_graphql/) is PostgreSQL extension for interacting with the database using [GraphQL](https://graphql.org) instead of SQL.The extension reflects a GraphQL schema from the existing SQL schema and exposes it through a SQL function, `graphql.resolve(...)`. This enables any programming language that can connect to PostgreSQL to query the database via GraphQL with no additional servers, processes, or libraries.-The `pg_graphql` resolve method is designed to interop with [PostgREST](https://postgrest.org/en/stable/index.html), the tool that underpins the Supabase API, such that the `graphql.resolve` function can be called via RPC to safely and performantly expose the GraphQL API over HTTP/s.+The `pg_graphql` resolve method is designed to interop with [PostgREST](https://postgrest.org/en/stable/index.html), the tool that underpins the Supabase API, such that the `graphql.resolve` function can be called via RPC to safely and performantly expose the GraphQL API over HTTP/S.For more information about how the SQL schema is reflected into a GraphQL schema, see the [pg_graphql API docs](https://supabase.github.io/pg_graphql/api/).-## Usage-### Enable the extension+## Enable the extension<Tabsscrollable@@ -103,7 +102,7 @@ returning the JSON}```-Note that pg_graphql fully supports schema introspection so you can connect any IDE or schema inspection tool to see the full set of fields and arguments available in the API.+Note that `pg_graphql` fully supports schema introspection so you can connect any GraphQL IDE or schema inspection tool to see the full set of fields and arguments available in the API.## APIdiff --git a/apps/docs/pages/guides/database/extensions/pg_hashids.mdx b/apps/docs/pages/guides/database/extensions/pg_hashids.mdxindex 7cab60f041c..ad02c19b1ff 100644--- a/apps/docs/pages/guides/database/extensions/pg_hashids.mdx+++ b/apps/docs/pages/guides/database/extensions/pg_hashids.mdx@@ -6,9 +6,9 @@ export const meta = {description: 'Generate Short UIDs from Numbers',}-[pg_hashids] provides a simple and secure way to generate short, unique, non-sequential ids from numbers. The hashes are intended to be small, easy-to-remember identifiers that can be used to obfuscate data (optionally) with a password, alphabet, and salt. For example, you may wish to hide data like user IDs, order numbers, or tracking codes in favor of `pg_hashid`'s unique identifers.+[pg_hashids](https://github.com/iCyberon/pg_hashids) provides a secure way to generate short, unique, non-sequential ids from numbers. The hashes are intended to be small, easy-to-remember identifiers that can be used to obfuscate data (optionally) with a password, alphabet, and salt. For example, you may wish to hide data like user IDs, order numbers, or tracking codes in favor of `pg_hashid`'s unique identifers.-### Enable the Extension+## Enable the Extension<Tabsscrollable@@ -37,7 +37,7 @@ drop extension if exists pg_hashids;Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension".To disable an extension you can call `drop extension`.-It's good practice to create the extension within a separate schema (like `extensions`) to keep your database clean.+It's good practice to create the extension within a separate schema (like `extensions`) to keep your `public` schema clean.</TabPanel></Tabs>@@ -78,4 +78,4 @@ To reverse the `short_id` back into an `id`, there is an equivalent function namexport const Page = ({ children }) => <Layout meta={meta} children={children} />-export default Page\ No newline at end of file+export default Pagediff --git a/apps/docs/pages/guides/database/extensions/pg_jsonschema.mdx b/apps/docs/pages/guides/database/extensions/pg_jsonschema.mdxindex ade2adf5271..4cf54f21a19 100644--- a/apps/docs/pages/guides/database/extensions/pg_jsonschema.mdx+++ b/apps/docs/pages/guides/database/extensions/pg_jsonschema.mdx@@ -6,11 +6,9 @@ export const meta = {description: 'Validate json/jsonb with JSON Schema in PostgreSQL.',}-[JSON Schema](https://json-schema.org) is a language for annotating and validating JSON documents. [`pg_jsonschema`](https://github.com/supabase/pg_jsonschema) is a PostgreSQL extension that adds the ability to validate PostgreSQL's built-in `json` and `jsonb` data types against a JSON Schema document.+[JSON Schema](https://json-schema.org) is a language for annotating and validating JSON documents. [`pg_jsonschema`](https://github.com/supabase/pg_jsonschema) is a PostgreSQL extension that adds the ability to validate PostgreSQL's built-in `json` and `jsonb` data types against JSON Schema documents.-## Usage--### Enable the extension+## Enable the extension<Tabsscrollable@@ -39,7 +37,7 @@ drop extension if exists pg_jsonschema;Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension".To disable an extension you can call `drop extension`.-It's good practice to create the extension within a separate schema (like `extensions`) to keep your database clean.+It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean.</TabPanel></Tabs>@@ -49,9 +47,9 @@ It's good practice to create the extension within a separate schema (like `exten- [`json_matches_schema(schema json, instance json)`](https://github.com/supabase/pg_jsonschema#api): Checks if a `json` _instance_ conforms to a JSON Schema _schema_.- [`jsonb_matches_schema(schema json, instance jsonb)`](https://github.com/supabase/pg_jsonschema#api): Checks if a `jsonb` _instance_ conforms to a JSON Schema _schema_.-### Validating a document+## Usage-Since `pg_jsonschema` exposes its utilities as functions, we can test it with a simple select statement:+Since `pg_jsonschema` exposes its utilities as functions, we can execute them with a select statement:{/* prettier-ignore */}```sql@@ -62,7 +60,7 @@ select);```-`pg_jsonschema` is generally used in tandem with a [check constraint](https://www.postgresql.org/docs/current/ddl-constraints.html) as a way to constrain the contents of a json/b field to match a JSON Schema.+`pg_jsonschema` is generally used in tandem with a [check constraint](https://www.postgresql.org/docs/current/ddl-constraints.html) as a way to constrain the contents of a json/b column to match a JSON Schema.{/* prettier-ignore */}```sqldiff --git a/apps/docs/pages/guides/database/extensions/pg_plan_filter.mdx b/apps/docs/pages/guides/database/extensions/pg_plan_filter.mdxindex 9c05b3a8058..ab46d931ffe 100644--- a/apps/docs/pages/guides/database/extensions/pg_plan_filter.mdx+++ b/apps/docs/pages/guides/database/extensions/pg_plan_filter.mdx@@ -64,7 +64,7 @@ explain select * from book;(1 row)```-Now we can choose a `statement_cost_filter` between the total cost for the single select (2.49) and the whole table select (135.0) so one statement will succeed and one will fail.+Now we can choose a `statement_cost_filter` value between the total cost for the single select (2.49) and the whole table select (135.0) so one statement will succeed and one will fail.{/* prettier-ignore */}```sqldiff --git a/apps/docs/pages/guides/database/extensions/pg_stat_monitor.mdx b/apps/docs/pages/guides/database/extensions/pg_stat_monitor.mdxindex bb70e9ebe41..d1a8da6ffb7 100644--- a/apps/docs/pages/guides/database/extensions/pg_stat_monitor.mdx+++ b/apps/docs/pages/guides/database/extensions/pg_stat_monitor.mdx@@ -8,12 +8,11 @@ export const meta = {[pg_stat_monitor](https://github.com/percona/pg_stat_monitor) is query performance monitoring tool that provides query execution statistics in a SQL view named `pg_stat_monitor`. It tracks a superset of statistics available in [`pg_stat_statements`](https://www.postgresql.org/docs/current/pgstatstatements.html). Some of the most useful features are:- **Time Interval Grouping**: configurable time buckets to track query usage over time-- **Capture Parameters**: optionally track parameters passed into queries instead of generic placeholders `$1`+- **Capture Parameters**: optionally track parameters passed into queries instead of generic placeholders e.g. `$1`- **Query Plan**: store query plans used for execution-## Usage-### Enable the extension+## Enable the extension<Tabsscrollable@@ -42,7 +41,7 @@ drop extension if exists pg_stat_monitor;Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension".To disable an extension you can call `drop extension`.-It's good practice to create the extension within a separate schema (like `extensions`) to keep your database clean.+It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean.</TabPanel></Tabs>@@ -72,7 +71,7 @@ The following table shows a subset of available columns:| total_plan_time double precision | Total time spent planning the statement, in milliseconds (if pg_stat_statements.track_planning is enabled, otherwise zero) || min_plan_time double precision | Minimum time spent planning the statement, in milliseconds (if pg_stat_statements.track_planning is enabled, otherwise zero) |-A full list of statistics is available in the [pg_stat_monitor](https://docs.percona.com/pg-stat-monitor/reference.html#postgresql-15) docs.+A full list of statistics is available in the [pg_stat_monitor docs](https://docs.percona.com/pg-stat-monitor/reference.html#postgresql-15).## Functions- [`pg_stat_monitor_reset()`](https://docs.percona.com/pg-stat-monitor/functions.html): Resets the statistics tracked by the `pg_stat_monitor` view and deletes all previous data.diff --git a/apps/docs/pages/guides/database/extensions/pg_stat_statements.mdx b/apps/docs/pages/guides/database/extensions/pg_stat_statements.mdxindex d97ce19eb7f..846cd2e5f04 100644--- a/apps/docs/pages/guides/database/extensions/pg_stat_statements.mdx+++ b/apps/docs/pages/guides/database/extensions/pg_stat_statements.mdx@@ -22,9 +22,8 @@ export const meta = {A full list of statistics is available in the [pg_stat_statements docs](https://www.postgresql.org/docs/current/pgstatstatements.html).-## Usage-### Enable the extension+## Enable the extension<Tabsscrollable@@ -53,12 +52,12 @@ drop extension if exists pg_stat_statements;Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension".To disable an extension you can call `drop extension`.-It's good practice to create the extension within a separate schema (like `extensions`) to keep your database clean.+It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean.</TabPanel></Tabs>-### Inspecting activity+## Inspecting activityA common use for `pg_stat_statements` is to track down expensive or slow queries. The `pg_stat_statements` view contains a row for each executed query with statistics inlined. For example, you can leverage the statistics to identify frequently executed and slow queries against a given table.@@ -82,7 +81,7 @@ order bycalls desc```-From the results, an informed decision about which queries to optimize, index, or adjust can be made.+From the results, we can make an informed decision about which queries to optimize or index.## Resourcesdiff --git a/apps/docs/pages/guides/database/extensions/pgaudit.mdx b/apps/docs/pages/guides/database/extensions/pgaudit.mdxindex 6019bbb992b..7dde02b6312 100644--- a/apps/docs/pages/guides/database/extensions/pgaudit.mdx+++ b/apps/docs/pages/guides/database/extensions/pgaudit.mdx@@ -10,9 +10,7 @@ export const meta = {PGAudit grants fine grain control over which statements and objects are emitted to logs.-## Usage--### Enable the extension+## Enable the extension<Tabsscrollablediff --git a/apps/docs/pages/guides/database/extensions/pgjwt.mdx b/apps/docs/pages/guides/database/extensions/pgjwt.mdxindex 097cad3e4d3..548925f8ad8 100644--- a/apps/docs/pages/guides/database/extensions/pgjwt.mdx+++ b/apps/docs/pages/guides/database/extensions/pgjwt.mdx@@ -8,9 +8,8 @@ export const meta = {The [pgjwt](https://github.com/michelp/pgjwt) (PostgreSQL JSON Web Token) extension allows you to create and parse [JSON Web Tokens (JWTs)](https://en.wikipedia.org/wiki/JSON_Web_Token) within a PostgreSQL database. JWTs are commonly used for authentication and authorization in web applications and services.-## Usage-### Enable the extension+## Enable the extension<Tabsscrollable@@ -39,7 +38,7 @@ drop extension if exists pgjwt;Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension".To disable an extension you can call `drop extension`.-It's good practice to create the extension within a separate schema (like `extensions`) to keep your database clean.+It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean.</TabPanel></Tabs>diff --git a/apps/docs/pages/guides/database/extensions/pgnet.mdx b/apps/docs/pages/guides/database/extensions/pgnet.mdxindex 18c51a8dd2a..3246fb4f5df 100644--- a/apps/docs/pages/guides/database/extensions/pgnet.mdx+++ b/apps/docs/pages/guides/database/extensions/pgnet.mdx@@ -16,9 +16,8 @@ The pg_net API is in alpha. Functions signatures may change.It differs from the `http` extension in that it is asynchronous by default. This makes it useful in blocking functions (like triggers).-## Usage-### Enable the extension+## Enable the extension<Tabsscrollablediff --git a/apps/docs/pages/guides/database/extensions/pgroonga.mdx b/apps/docs/pages/guides/database/extensions/pgroonga.mdxindex f006857303c..11985d92742 100644--- a/apps/docs/pages/guides/database/extensions/pgroonga.mdx+++ b/apps/docs/pages/guides/database/extensions/pgroonga.mdx@@ -8,9 +8,8 @@ export const meta = {`PGroonga` is a PostgreSQL extension adding a full text search indexing method based on [Groonga](https://groonga.org). While native PostgreSQL supports full text indexing, it is limited to alphabet and digit based languages. `PGroonga` offers a wider range of character support making it viable for a superset of languages supported by PostgreSQL including Japanese, Chinese, etc.-## Usage-### Enable the extension+## Enable the extension<Tabsscrollable@@ -39,12 +38,10 @@ drop extension if exists pgroonga;Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension".To disable an extension you can call `drop extension`.-It's good practice to create the extension within a separate schema (like `extensions`) to keep your database clean.-</TabPanel></Tabs>-### Creating a full text search index+## Creating a full text search indexGiven a table with a `text` column:diff --git a/apps/docs/pages/guides/database/extensions/pgrouting.mdx b/apps/docs/pages/guides/database/extensions/pgrouting.mdxindex 45b55737f80..3c94f81adc5 100644--- a/apps/docs/pages/guides/database/extensions/pgrouting.mdx+++ b/apps/docs/pages/guides/database/extensions/pgrouting.mdx@@ -8,7 +8,7 @@ export const meta = {[pgRouting](http://pgrouting.org) is PostgreSQL and [PostGIS](http://postgis.net) extension adding geospatial routing functionality.-The core functionality of pgRouting is a set of path finding algorithms including:+The core functionality of `pgRouting` is a set of path finding algorithms including:- All Pairs Shortest Path, Johnson’s Algorithm- All Pairs Shortest Path, Floyd-Warshall Algorithm@@ -22,9 +22,8 @@ The core functionality of pgRouting is a set of path finding algorithms includin- Traveling Sales Person- Turn Restriction Shortest Path (TRSP)-## Usage-### Enable the extension+## Enable the extension<Tabsscrollable@@ -56,7 +55,7 @@ To disable an extension you can call `drop extension`.</TabPanel></Tabs>-## Example Usage+## ExampleAs an example, we'll solve the [traveling salesman probelem](https://en.wikipedia.org/wiki/Travelling_salesman_problem) using the pgRouting's `pgr_TSPeuclidean` function from some PostGIS coodinates.diff --git a/apps/docs/pages/guides/database/extensions/pgtap.mdx b/apps/docs/pages/guides/database/extensions/pgtap.mdxindex fc642b522ab..219eedd11ee 100644--- a/apps/docs/pages/guides/database/extensions/pgtap.mdx+++ b/apps/docs/pages/guides/database/extensions/pgtap.mdx@@ -15,9 +15,7 @@ Let's cover some basic concepts:- Unit tests: allow you to test small parts of a system (like a database table!).- TAP: stands for [Test Anything Protocol](http://testanything.org/). It is an framework which aims to simplify the error reporting during testing.-## Usage--### Enable the extension+## Enable the extension<Tabsscrollable@@ -45,12 +43,12 @@ drop extension if exists pgtap;Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension".To disable an extension you can call `drop extension`.-It's good practice to create the extension within a separate schema (like `extensions`) to keep your database clean.+It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean.</TabPanel></Tabs>-### Testing tables+## Testing tables```sqlbegin;@@ -68,7 +66,7 @@ API:- [`has_index()`](https://pgtap.org/documentation.html#has_index): Checks for the existence of a named index associated with the named table.- [`has_relation()`](https://pgtap.org/documentation.html#has_relation): Tests whether or not a relation exists in the database.-### Testing columns+## Testing columns```sqlbegin;@@ -86,7 +84,7 @@ API:- [`has_column()`](https://pgtap.org/documentation.html#has_column): Tests whether or not a column exists in a given table, view, materialized view or composite type.- [`col_is_pk()`](https://pgtap.org/documentation.html#col_is_pk): Tests whether the specified column or columns in a table is/are the primary key for that table.-### Testing RLS Policies+## Testing RLS Policies```sqlbegin;@@ -133,7 +131,7 @@ API:- [`results_eq()`](https://pgtap.org/documentation.html#results_eq)- [`results_ne()`](https://pgtap.org/documentation.html#results_ne)-### Testing Functions+## Testing Functions```sqlbegin;diff --git a/apps/docs/pages/guides/database/extensions/plpgsql_check.mdx b/apps/docs/pages/guides/database/extensions/plpgsql_check.mdxindex 8a9fb7bfde4..a064f463df6 100644--- a/apps/docs/pages/guides/database/extensions/plpgsql_check.mdx+++ b/apps/docs/pages/guides/database/extensions/plpgsql_check.mdx@@ -6,11 +6,9 @@ export const meta = {description: 'Lint PL/pgSQL code',}-plpg_sqlcheck is a PostgreSQL extension that lints plpgsql for syntax, semantic and other related issues. The tool helps developers to identify and correct errors before executing the code. plpgsql_sqlcheck is most useful for developers who are working with large or complex SQL codebases, as it can help identify and resolve issues early in the development cycle.+[plpgsql_check](https://github.com/okbob/plpgsql_check) is a PostgreSQL extension that lints plpgsql for syntax, semantic and other related issues. The tool helps developers to identify and correct errors before executing the code. plpgsql_check is most useful for developers who are working with large or complex SQL codebases, as it can help identify and resolve issues early in the development cycle.-## Usage--### Enable the extension+## Enable the extension<Tabsscrollable@@ -46,11 +44,11 @@ To disable an extension you can call `drop extension`.- [`plpgsql_check_function( ... )`](https://github.com/okbob/plpgsql_check#active-mode): Scans a function for errors.-`plpgsql_check_function` is highly customizable. For a complete list of available arguments see [their doc](https://github.com/okbob/plpgsql_check#arguments)+`plpgsql_check_function` is highly customizable. For a complete list of available arguments see [the docs](https://github.com/okbob/plpgsql_check#arguments)## Usage-To demonstrate plpgsql_check we can create a function with a known error. In this case we create a function `some_func`, that references a non-existent column `location.created_at`.+To demonstrate `plpgsql_check` we can create a function with a known error. In this case we create a function `some_func`, that references a non-existent column `place.created_at`.{/* prettier-ignore */}```sql@@ -68,7 +66,7 @@ declarebeginfor rec in select * from placeloop- -- Bug: There is no column `created_at` on table `location`+ -- Bug: There is no column `created_at` on table `place`raise notice '%', rec.created_at;end loop;end;diff --git a/apps/docs/pages/guides/database/extensions/plv8.mdx b/apps/docs/pages/guides/database/extensions/plv8.mdxindex eb408b2c30f..db78b843941 100644--- a/apps/docs/pages/guides/database/extensions/plv8.mdx+++ b/apps/docs/pages/guides/database/extensions/plv8.mdx@@ -15,9 +15,8 @@ While Postgres natively runs SQL, it can also run other "procedural languages".It can be used for database functions, triggers, queries and more.-## Usage-### Enable the extension+## Enable the extension<Tabsscrollable@@ -50,7 +49,7 @@ Procedural languages are automatically installed within `pg_catalog`, so you don</TabPanel></Tabs>-### Create `plv8` functions+## Create `plv8` functionsFunctions written in `plv8` are written just like any other PostgreSQL functions, onlywith the `language` identifier set to `plv8`.diff --git a/apps/docs/pages/guides/database/extensions/postgis.mdx b/apps/docs/pages/guides/database/extensions/postgis.mdxindex 6f241b0774e..9e9a65098ad 100644--- a/apps/docs/pages/guides/database/extensions/postgis.mdx+++ b/apps/docs/pages/guides/database/extensions/postgis.mdx@@ -14,9 +14,7 @@ While you may be able to store simple lat/long geographic coordinates as a set oThe additional data types that PostGIS provides include [Point](https://postgis.net/docs/using_postgis_dbmanagement.html#Point), [Polygon](https://postgis.net/docs/using_postgis_dbmanagement.html#Polygon), [Linestring](https://postgis.net/docs/using_postgis_dbmanagement.html#LineString), and many more to represent different types of geographical data. In this guide, we will mainly focus on how to interact with `Point` type, which represents a single set of latitude and longitude. If you are interested in digging deeper, you can learn more about different data types on the [data management section of PostGIS docs](https://postgis.net/docs/using_postgis_dbmanagement.html).-## Usage--### Enable the extension+## Enable the extensionYou can get started with PostGIS by enabling the PostGIS extension in your Supabase dashboard.diff --git a/apps/docs/pages/guides/database/extensions/timescaledb.mdx b/apps/docs/pages/guides/database/extensions/timescaledb.mdxindex 2ce81cfb74d..e00228b0288 100644--- a/apps/docs/pages/guides/database/extensions/timescaledb.mdx+++ b/apps/docs/pages/guides/database/extensions/timescaledb.mdx@@ -10,9 +10,8 @@ export const meta = {`timescaledb` uses a time-series-aware storage model and indexing techniques to improve performance of PostgreSQL in working with time-series data. The extension divides data into chunks based on time intervals, allowing it to scale efficiently, especially for large data sets. The data is then compressed, optimized for write-heavy workloads, and partitioned for parallel processing. `timescaledb` also includes a set of functions, operators, and indexes that work with time-series data to reduce query times, and make data easier to work with.-## Usage-### Enable the extension+## Enable the extension<Tabsscrollable@@ -58,7 +57,7 @@ create table temperatures (select create_hypertable('temperatures', 'time');```-Next we can populate some values+Next, we can populate some values{/* prettier-ignore */}```sqldiff --git a/apps/docs/pages/guides/database/extensions/uuid-ossp.mdx b/apps/docs/pages/guides/database/extensions/uuid-ossp.mdxindex 167e9b92807..b270fdd581f 100644--- a/apps/docs/pages/guides/database/extensions/uuid-ossp.mdx+++ b/apps/docs/pages/guides/database/extensions/uuid-ossp.mdx@@ -13,9 +13,7 @@ The `uuid-ossp` extension can be used to generate a `UUID`.A `UUID` is a "Universally Unique Identifier" and it is, for practical purposes, unique.This makes them particularly well suited as Primary Keys. It is occasionally referred to as a `GUID`, which stands for "Globally Unique Identifier".-## Usage--### Enable the extension+## Enable the extension<Tabsscrollable@@ -46,7 +44,7 @@ drop extension if exists "uuid-ossp";Even though the SQL code is `create extension`, this is the equivalent of "enabling the extension".To disable an extension, call `drop extension`.-It's good practice to create the extension within a separate schema (like `extensions`) to keep your database clean.+It's good practice to create the extension within a separate schema (like `extensions`) to keep the `public` schema clean.**Note**:Currently `uuid-ossp` extension is enabled by default and cannot be disabled.@@ -54,11 +52,11 @@ Currently `uuid-ossp` extension is enabled by default and cannot be disabled.</TabPanel></Tabs>-### The `uuid` type+## The `uuid` typeOnce the extension is enabled, you now have access to a `uuid` type.-### `uuid_generate_v1()`+## `uuid_generate_v1()`Creates a UUID value based on the combination of computer’s MAC address, current timestamp, and a random value.@@ -67,7 +65,7 @@ Creates a UUID value based on the combination of computer’s MAC address, curreapplications.</Admonition>-### `uuid_generate_v4()`+## `uuid_generate_v4()`Creates UUID values based solely on random numbers. You can also use Postgres's built-in [`gen_random_uuid()`](https://www.postgresql.org/docs/current/functions-uuid.html) function to generate a UUIDv4.diff --git a/apps/docs/pages/guides/database/extensions/wrappers.mdx b/apps/docs/pages/guides/database/extensions/wrappers.mdxindex 2673d17f037..943b1dd6391 100644--- a/apps/docs/pages/guides/database/extensions/wrappers.mdx+++ b/apps/docs/pages/guides/database/extensions/wrappers.mdx@@ -46,7 +46,7 @@ from{/* prettier-ignore */}```sql-- Enable the "wrappers" extension-create extension wrappers with schema extensions;+create extension wrappers;-- Disable the "wrappers" extensiondrop extension if exists wrappers;