From 28becaecca6220ee96dbf02118d5d4ada4725976 Mon Sep 17 00:00:00 2001 From: Soeren Wolfers Date: Sun, 8 Dec 2024 16:09:35 +0000 Subject: [PATCH 1/5] Update postgresql_compatibility.md --- docs/sql/dialect/postgresql_compatibility.md | 37 +++++++------------- 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/docs/sql/dialect/postgresql_compatibility.md b/docs/sql/dialect/postgresql_compatibility.md index 586a7a46d0..26fe110c6f 100644 --- a/docs/sql/dialect/postgresql_compatibility.md +++ b/docs/sql/dialect/postgresql_compatibility.md @@ -44,12 +44,9 @@ SELECT 1 / 2 AS x; PostgreSQL returns: -```text - x ---- - 0 -(1 row) -``` +| x | +| ---: | +| 0 | DuckDB returns: @@ -162,14 +159,9 @@ SELECT 1 == 1 AS t; DuckDB returns: -```text -┌─────────┐ -│ t │ -│ boolean │ -├─────────┤ -│ true │ -└─────────┘ -``` +| t | +| ---: | +| true | Postgres returns: @@ -218,8 +210,7 @@ PostgreSQL returns an error on the last statement: ```console ERROR: type "mytype" does not exist -LINE 1: CREATE TABLE myschema.mytable (v mytype); - ^ +LINE 1: CREATE TABLE myschema.mytable (v mytype); ^ ``` DuckDB runs the statement and creates the table successfully, confirmed by the following query: @@ -228,11 +219,9 @@ DuckDB runs the statement and creates the table successfully, confirmed by the f DESCRIBE myschema.mytable; ``` -```text -┌─────────────┬──────────────────┬─────────┬─────────┬─────────┬─────────┐ -│ column_name │ column_type │ null │ key │ default │ extra │ -│ varchar │ varchar │ varchar │ varchar │ varchar │ varchar │ -├─────────────┼──────────────────┼─────────┼─────────┼─────────┼─────────┤ -│ v │ ENUM('as', 'df') │ YES │ NULL │ NULL │ NULL │ -└─────────────┴──────────────────┴─────────┴─────────┴─────────┴─────────┘ -``` +
+ +| column_name | column_type | null | key | default | extra | +|-------------|------------------|------|------|---------|-------| +| v | ENUM('as', 'df') | YES | NULL | NULL | NULL | + From db1b37ffe795dc31dae30e796760faca436ff8f3 Mon Sep 17 00:00:00 2001 From: Soeren Wolfers Date: Sun, 8 Dec 2024 16:11:35 +0000 Subject: [PATCH 2/5] Update postgresql_compatibility.md --- docs/sql/dialect/postgresql_compatibility.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/sql/dialect/postgresql_compatibility.md b/docs/sql/dialect/postgresql_compatibility.md index 26fe110c6f..c3efde79a6 100644 --- a/docs/sql/dialect/postgresql_compatibility.md +++ b/docs/sql/dialect/postgresql_compatibility.md @@ -44,12 +44,16 @@ SELECT 1 / 2 AS x; PostgreSQL returns: +
+ | x | | ---: | | 0 | DuckDB returns: +
+ | x | | ---: | | 0.5 | @@ -60,6 +64,8 @@ To perform integer division in DuckDB, use the `//` operator: SELECT 1 // 2 AS x; ``` +
+ | x | | ---: | | 0 | @@ -82,6 +88,9 @@ ERROR: UNION types boolean and integer cannot be matched DuckDB performs an enforced cast, therefore, it completes the query and returns the following: + +
+ | x | | ---: | | 1 | @@ -219,7 +228,7 @@ DuckDB runs the statement and creates the table successfully, confirmed by the f DESCRIBE myschema.mytable; ``` -
+
| column_name | column_type | null | key | default | extra | |-------------|------------------|------|------|---------|-------| From 539614a3f365fcd5ec79e8e7eee808a3a8973101 Mon Sep 17 00:00:00 2001 From: Soeren Wolfers Date: Sun, 8 Dec 2024 16:12:08 +0000 Subject: [PATCH 3/5] Update postgresql_compatibility.md --- docs/sql/dialect/postgresql_compatibility.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/sql/dialect/postgresql_compatibility.md b/docs/sql/dialect/postgresql_compatibility.md index c3efde79a6..25ccc1ccc3 100644 --- a/docs/sql/dialect/postgresql_compatibility.md +++ b/docs/sql/dialect/postgresql_compatibility.md @@ -168,6 +168,8 @@ SELECT 1 == 1 AS t; DuckDB returns: +
+ | t | | ---: | | true | From 1ded7128e37860e3f8fd63b4a14d8d0f8346bae1 Mon Sep 17 00:00:00 2001 From: Soeren Wolfers Date: Sun, 8 Dec 2024 16:12:29 +0000 Subject: [PATCH 4/5] Update postgresql_compatibility.md --- docs/sql/dialect/postgresql_compatibility.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sql/dialect/postgresql_compatibility.md b/docs/sql/dialect/postgresql_compatibility.md index 25ccc1ccc3..089b2cb11a 100644 --- a/docs/sql/dialect/postgresql_compatibility.md +++ b/docs/sql/dialect/postgresql_compatibility.md @@ -168,7 +168,7 @@ SELECT 1 == 1 AS t; DuckDB returns: -
+
| t | | ---: | From ca3a465f6ae68565ca5f6287511311eb216f8229 Mon Sep 17 00:00:00 2001 From: Gabor Szarnyas Date: Sun, 8 Dec 2024 18:35:14 +0100 Subject: [PATCH 5/5] Update docs/sql/dialect/postgresql_compatibility.md --- docs/sql/dialect/postgresql_compatibility.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sql/dialect/postgresql_compatibility.md b/docs/sql/dialect/postgresql_compatibility.md index 089b2cb11a..6b5c3895fb 100644 --- a/docs/sql/dialect/postgresql_compatibility.md +++ b/docs/sql/dialect/postgresql_compatibility.md @@ -221,7 +221,7 @@ PostgreSQL returns an error on the last statement: ```console ERROR: type "mytype" does not exist -LINE 1: CREATE TABLE myschema.mytable (v mytype); ^ +LINE 1: CREATE TABLE myschema.mytable (v mytype); ``` DuckDB runs the statement and creates the table successfully, confirmed by the following query: