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: README.md
+42-29Lines changed: 42 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -40,10 +40,14 @@ Features
40
40
- `timestamp`: `text` and `int`,
41
41
- `uuid`: `text`(32..39) and `blob`(16),
42
42
- `bool`: `text`(1..5) and `int`,
43
-
- `double precision`, `float` and `numeric`: `real` values and special values with `text` affinity (`+Infinity`, `-Infinity`, `NaN`).
43
+
- `double precision`, `float` and `numeric`: `real` values and special values with `text` affinity (`+Infinity`, `-Infinity`, `NaN`),
44
+
- `macaddr`: `text`(12..17) or `blob`(6) or `integer`,
45
+
- `macaddr8`: `text`(16..23) or `blob`(8) or `integer`.
44
46
- Support mixed SQLite [data affinity](https://www.sqlite.org/datatype3.html) output (`INSERT`/`UPDATE`) for such data types as
45
47
- `timestamp`: `text`(default) or `int`,
46
-
- `uuid`: `text`(36) or `blob`(16)(default).
48
+
- `uuid`: `text`(36) or `blob`(16)(default),
49
+
- `macaddr`: `text`(17) or `blob`(6) or `integer`(default),
50
+
- `macaddr8`: `text`(23) or `blob`(8) or `integer`(default).
47
51
- Full support for `+Infinity` (means ∞) and `-Infinity` (means -∞) special values for IEEE 754-2008 numbers in `double precision`, `float` and `numeric` columns including such conditions as ` n < '+Infinity'` or ` m > '-Infinity'`.
48
52
49
53
### Pushdowning
@@ -58,6 +62,7 @@ Features
58
62
-`upper`, `lower` and other character case functions are **not** pushed down because they does not work with UNICODE character in SQLite.
59
63
-`WITH TIES` option is **not** pushed down.
60
64
- Bit string `#` (XOR) operator is **not** pushed down because there is no equal SQLite operator.
65
+
- Operations with `macaddr` or `macaddr8` data are **not** pushed down.
61
66
62
67
### Notes about pushdowning
63
68
@@ -155,9 +160,7 @@ Usage
155
160
156
161
### CREATE USER MAPPING options
157
162
158
-
There is no user or password conceptions in SQLite, hence `sqlite_fdw` no need any `CREATE USER MAPPING` command.
159
-
160
-
About access model and possible data modifications problems see about [connection to SQLite database file and access control](#connection-to-sqlite-database-file-and-access-control).
163
+
There is no user or password conceptions in SQLite, hence `sqlite_fdw` no need any `CREATE USER MAPPING` command. About access model and possible data modifications problems see about [connection to SQLite database file and access control](#connection-to-sqlite-database-file-and-access-control).
161
164
162
165
### CREATE FOREIGN TABLE options
163
166
@@ -199,42 +202,46 @@ in SQLite (mixed affinity case). Updated and inserted values will have this affi
199
202
200
203
Indicates a column as a part of primary key or unique key of SQLite table.
201
204
202
-
#### Datatypes
203
-
**WARNING! The table below represents roadmap**, work still in progress. Until it will be ended please refer real behaviour in non-obvious cases, where there is no ✔ or ∅ mark.
204
-
205
+
### Datatypes
205
206
This table represents `sqlite_fdw` behaviour if in PostgreSQL foreign table column some [affinity](https://www.sqlite.org/datatype3.html) of SQLite data is detected. Some details about data values support see in [limitations](#limitations).
206
207
207
-
***∅** - no support (runtime error)
208
-
***V** - transparent transformation
209
-
***T** - cast to text in SQLite utf-8 encoding, then to **PostgreSQL text with current encoding of database** and then transparent transformation if applicable
210
-
***✔** - transparent transformation where PostgreSQL datatype is equal to SQLite affinity
211
-
***V+** - transparent transformation if appliacable
208
+
***∅** - no support (runtime error)
209
+
***✔** - 1↔1, PostgreSQL datatype is equal to SQLite affinity
210
+
***✔-** - PostgreSQL datatype is equal to SQLite affinity, but possible out of range error
211
+
***V** - transparent transformation if possible
212
+
***V+** - transparent transformation if possible
213
+
***i** - ISO:SQL transformation for some special constants
212
214
***?** - not described/not tested
213
-
***-** - transparent transformation is possible for PostgreSQL (always or for some special values), but not implemented in `sqlite_fdw`.
215
+
***T** - cast to text in SQLite utf-8 encoding, then to **PostgreSQL text with current encoding of database** and then transformation for `text` affinity if applicable
214
216
215
217
SQLite `NULL` affinity always can be transparent converted for a nullable column in PostgreSQL.
216
218
217
-
| PostgreSQL | SQLite <br> INT | SQLite <br> REAL | SQLite <br> BLOB | SQLite <br> TEXT | SQLite <br> TEXT but <br>empty|SQLite<br>nearest<br>affinity|
219
+
**SQLite data processing dependend on affinity**
220
+
221
+
| PostgreSQL | INT | REAL | BLOB | TEXT | TEXT but <br>empty|nearest<br>affinity|
@@ -249,7 +256,7 @@ SQLite `NULL` affinity always can be transparent converted for a nullable column
249
256
250
257
Allow borrowing `NULL`/`NOT NULL` constraints from SQLite table DDL.
251
258
252
-
#### Datatype tranlsation rules for `IMPORT FOREIGN SCHEMA`
259
+
#### Datatype translation rules for `IMPORT FOREIGN SCHEMA`
253
260
254
261
| SQLite | PostgreSQL |
255
262
|-------------:|:----------------:|
@@ -265,6 +272,8 @@ SQLite `NULL` affinity always can be transparent converted for a nullable column
265
272
| time | time |
266
273
| date | date |
267
274
| uuid | uuid |
275
+
| macaddr | macaddr |
276
+
| macaddr8 | macaddr8 |
268
277
269
278
### TRUNCATE support
270
279
@@ -587,6 +596,10 @@ for `INSERT` and `UPDATE` commands. PostgreSQL supports both `blob` and `text` [
587
596
-`sqlite_fdw` PostgreSQL `bit`/`varbit` values support based on `int` SQLite data affinity, because there is no per bit operations for SQLite `blob` affinity data. Maximum SQLite `int` affinity value is 8 bytes length, hence maximum `bit`/`varbit` values length is 64 bits.
588
597
-`sqlite_fdw` doesn't pushdown `#` (XOR) operator because there is no equal SQLite operator.
589
598
599
+
### MAC address support
600
+
-`sqlite_fdw` PostgreSQL `macaddr`/`macaddr8` values support based on `int` SQLite data affinity, because there is no per bit operations for SQLite `blob` affinity data. For `macaddr` out of range error is possible because this type is 6 bytes length, but SQLite `int` can store value up to 8 bytes.
601
+
-`sqlite_fdw` doesn't pushdown any operations with MAC adresses because there is 3 possible affinities for it in SQLite: `integer`, `blob` and `text`.
0 commit comments