From a9fd01ad9aa64be75137b57186fe8a7afc7aed64 Mon Sep 17 00:00:00 2001 From: fpagny Date: Thu, 26 Sep 2024 12:05:22 +0200 Subject: [PATCH 1/2] Update known-differences.mdx Fix and align wording on PostgreSQL commands which cannot be performed. Add a workaround snippet regarding SET/RESET features inside a transaction. --- .../reference-content/known-differences.mdx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/serverless/sql-databases/reference-content/known-differences.mdx b/serverless/sql-databases/reference-content/known-differences.mdx index 87f599f200..073daeaebe 100644 --- a/serverless/sql-databases/reference-content/known-differences.mdx +++ b/serverless/sql-databases/reference-content/known-differences.mdx @@ -33,7 +33,7 @@ If you require strict compatibility with all PostgreSQL features, you can use [M NOTIFY channel, 'message'; ``` -- Creating temporary tables or views is not supported. +- Creating temporary tables or views cannot be performed. ```sql CREATE TEMPORARY TABLE table as {query}; @@ -50,7 +50,7 @@ If you require strict compatibility with all PostgreSQL features, you can use [M You can still refresh materialized views without the `CONCURRENTLY` option. -- Declaring a cursor in transactions with `WITH HOLD` is not supported. +- Declaring a cursor in transactions with `WITH HOLD` can be performed, but accurate cursor handling is not guaranteed, especially when using multiple connections. ```sql BEGIN; @@ -64,7 +64,7 @@ If you require strict compatibility with all PostgreSQL features, you can use [M CREATE SUBSCRIPTION subscription CONNECTION 'connection' PUBLICATION publication; ``` -- Preparing transactions is not supported. +- Preparing transactions cannot be performed. ```sql PREPARE TRANSACTION 'transactionid'; @@ -117,6 +117,14 @@ If you require strict compatibility with all PostgreSQL features, you can use [M SET TIME ZONE 'Europe/Paris'; RESET timezone; ``` + If you require this features to work consistently for a given SQL query, we suggest you set them in transactions: + ```sql + BEGIN; + SET TIME ZONE 'Europe/Paris'; + SHOW timezone; + COMMIT; + ``` + In this example, `SHOW timezone` will always display `Europe/Paris` without any impact from any other connection despite connection pooling. - Security labels cannot be defined or changed. From 92f27f3f4d1f3867a2faca7d233edf9813a407da Mon Sep 17 00:00:00 2001 From: SamyOubouaziz Date: Fri, 27 Sep 2024 15:17:39 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Jessica <113192637+jcirinosclwy@users.noreply.github.com> --- .../sql-databases/reference-content/known-differences.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/serverless/sql-databases/reference-content/known-differences.mdx b/serverless/sql-databases/reference-content/known-differences.mdx index 073daeaebe..de6728b747 100644 --- a/serverless/sql-databases/reference-content/known-differences.mdx +++ b/serverless/sql-databases/reference-content/known-differences.mdx @@ -33,7 +33,7 @@ If you require strict compatibility with all PostgreSQL features, you can use [M NOTIFY channel, 'message'; ``` -- Creating temporary tables or views cannot be performed. +- It is not possible to create temporary tables or views. ```sql CREATE TEMPORARY TABLE table as {query}; @@ -50,7 +50,7 @@ If you require strict compatibility with all PostgreSQL features, you can use [M You can still refresh materialized views without the `CONCURRENTLY` option. -- Declaring a cursor in transactions with `WITH HOLD` can be performed, but accurate cursor handling is not guaranteed, especially when using multiple connections. +- You can declare a cursor in transactions with `WITH HOLD`, but accurate cursor handling is not guaranteed, particularly when using multiple connections. ```sql BEGIN; @@ -64,7 +64,7 @@ If you require strict compatibility with all PostgreSQL features, you can use [M CREATE SUBSCRIPTION subscription CONNECTION 'connection' PUBLICATION publication; ``` -- Preparing transactions cannot be performed. +- It is not possible to prepare transactions. ```sql PREPARE TRANSACTION 'transactionid'; @@ -117,7 +117,7 @@ If you require strict compatibility with all PostgreSQL features, you can use [M SET TIME ZONE 'Europe/Paris'; RESET timezone; ``` - If you require this features to work consistently for a given SQL query, we suggest you set them in transactions: + If you require these features to work consistently for a given SQL query, we suggest you set them in transactions: ```sql BEGIN; SET TIME ZONE 'Europe/Paris';