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
| 3 | key | ATTRIBUTE | Optional | Primary key or unique key of SQLite table. |
39
+
| 4 | column_type | ATTRIBUTE | Optional | Option to convert INT SQLite column (epoch Unix Time) to be treated/visualized as TIMESTAMP in PostgreSQL. |
40
+
| 5 | column_name | ATTRIBUTE | Optional | This option gives the column name to use for the column on the remote server. |
41
+
| 6 | truncatable | SERVER,<br>FOREIGN TABLE | Optional | This option controls whether sqlite_fdw allows foreign tables to be truncated using the TRUNCATE command. |
42
+
31
43
### Load extension
32
44
<pre>
33
45
CREATE EXTENSION sqlite_fdw;
@@ -67,11 +79,12 @@ SELECT * FROM t1;
67
79
</pre>
68
80
69
81
## Features
70
-
- Support update to foreign table
82
+
- Support INSERT/UPDATE/DELETE (both Direct modification and Foreign modification).
71
83
- WHERE clauses are pushdowned
72
84
- Aggregate function are pushdowned
73
85
- Order By is pushdowned
74
-
- Joins (left/right/inner) are pushdowned
86
+
- Joins (left/right/inner/cross) are pushdowned
87
+
- CASE expressions are pushdowned.
75
88
- Limit and Offset are pushdowned (*when all tables queried are fdw)
76
89
- Transactions
77
90
- Support TRUNCATE by deparsing into DELETE statement without WHERE clause
@@ -80,17 +93,34 @@ SELECT * FROM t1;
80
93
- Support discard cached connections to foreign servers by using function sqlite_fdw_disconnect(), sqlite_fdw_disconnect_all().
81
94
- Support Bulk Insert by using batch_size option
82
95
- Support Insert/Update with generated column
83
-
96
+
- Support GROUP BY, HAVING push-down.
97
+
- Support ON CONFLICT DO NOTHING.
84
98
## Limitations
85
99
-`COPY` command for foreign tables is not supported
86
100
- IMPORT of generated column is not supported
87
-
- Insert into a partitioned table which has foreign partitions is not supported
101
+
- Insert into a partitioned table which has foreign partitions is not supported. Error "Not support partition insert" will display.
88
102
- TRUNCATE in sqlite_fdw always delete data of both parent and child tables (no matter user inputs `TRUNCATE table CASCADE` or `TRUNCATE table RESTRICT`) if there are foreign-keys references with "ON DELETE CASCADE" clause.
103
+
- RETURNING is not supported.
104
+
105
+
## Notes
106
+
- SQLite evaluates division by zero as NULL. It is different from PostgreSQL, which will display "Division by zero" error.
107
+
- The data type of column of foreign table should match with data type of column in SQLite to avoid wrong result. For example, if the column of SQLite is float (which will be stored as float8), the column of foreign table should be float8, too. If the column of foreign table is float4, it may cause wrong result when select.
108
+
- For 'key' option, user needs to specify the primary key column of SQLite table corresponding with the 'key' option. If not, wrong result may occur when update or delete.
109
+
- When Sum of data in table is out of range, SQLite FDW will display "Infinity" value. It is different from PostgreSQL FDW, which will display "ERROR: value out of range: overflow" error.
110
+
- For push-down case, the number after floating point may be different from the result of PostgreSQL.
111
+
- For numeric type, SQLite FDW use sqlite3_column_double to get value, while SQLite shell uses sqlite3_column_text to get value. Those 2 APIs may return different numeric value. Therefore, for numeric type, the value returned from SQLite FDW may different from the value returned from SQLite shell.
112
+
- SQLite FDW can return implementation-dependent order for column if the column is not specified in ORDER BY clause.
113
+
- WITH TIES option is not pushed down.
114
+
- upper, lower functions are not pushed down because they does not work with UNICODE character in SQLite.
115
+
- When the column type is varchar array, if the string is shorter than the declared length, values of type character will be space-padded; values of type character varying will simply store the shorter string.
116
+
- SQLite FDW only supports ARRAY const, for example, ANY (ARRAY[1, 2, 3]) or ANY ('{1, 2 ,3}'). SQlite FDW does not support ARRAY expression, for example, ANY (ARRAY[c1, 1, c1+0]). For ANY(ARRAY) clause, SQLite FDW deparses it using IN operator.
117
+
- For sum function of SQLite, output of sum(bigint) is integer value. If input values are big, the overflow error may occurs on SQLite because it overflow within the range of signed 64bit. For PostgreSQL, it can calculate as over the precision of bigint, so overflow does not occur.
118
+
- SQLite promises to preserve the 15 most significant digits of a floating point value. The big value which exceed 15 most significant digits may become different value after inserted.
89
119
## Contributing
90
120
Opening issues and pull requests on GitHub are welcome.
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
0 commit comments