From 6cbd1333f615e5c3f7e1d010ea6e0f4930835096 Mon Sep 17 00:00:00 2001 From: Ilan Uzan Date: Sun, 31 Aug 2025 22:09:29 +0200 Subject: [PATCH] fix: update Postgres docs --- README.md | 14 ++++++-------- docs/04_Postgres.md | 14 ++++++-------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index e9757a5c..21017fb8 100644 --- a/README.md +++ b/README.md @@ -229,18 +229,16 @@ we consider support for the different data types separately for batch inserts an see [here](https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME) - so we decided not to implement support for it. -*** Some data types require conversion in the INSERT statement, and SQLC disallows argument conversion in queries with `:copyfrom` annotation, -which are used for batch inserts. These are the data types that require this conversion: +*** Some data types require conversion in the INSERT statement, and SQLC disallows argument conversion in queries with `:copyfrom` annotation, which are used for batch inserts. +These are the data types that require this conversion: 1. `macaddr8` -2. `json` -3. `jsonb` -4. `jsonpath` -5. `xml` -6. `enum` +2. `jsonpath` +3. `xml` +4. `enum` An example of this conversion: ```sql -INSERT INTO tab1 (json_field) VALUES (sqlc.narg('json_field')::json); +INSERT INTO tab1 (macaddr8_field) VALUES (sqlc.narg('macaddr8_field')::macaddr8); ``` diff --git a/docs/04_Postgres.md b/docs/04_Postgres.md index 55354226..54fb2df4 100644 --- a/docs/04_Postgres.md +++ b/docs/04_Postgres.md @@ -72,18 +72,16 @@ we consider support for the different data types separately for batch inserts an see [here](https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME) - so we decided not to implement support for it. -*** Some data types require conversion in the INSERT statement, and SQLC disallows argument conversion in queries with `:copyfrom` annotation, -which are used for batch inserts. These are the data types that require this conversion: +*** Some data types require conversion in the INSERT statement, and SQLC disallows argument conversion in queries with `:copyfrom` annotation, which are used for batch inserts. +These are the data types that require this conversion: 1. `macaddr8` -2. `json` -3. `jsonb` -4. `jsonpath` -5. `xml` -6. `enum` +2. `jsonpath` +3. `xml` +4. `enum` An example of this conversion: ```sql -INSERT INTO tab1 (json_field) VALUES (sqlc.narg('json_field')::json); +INSERT INTO tab1 (macaddr8_field) VALUES (sqlc.narg('macaddr8_field')::macaddr8); ```