Skip to content

Commit

Permalink
Fix squashed commits
Browse files Browse the repository at this point in the history
  • Loading branch information
mkgrgis committed Dec 28, 2023
1 parent f5c665d commit 3835967
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,19 @@ SQLite `NULL` affinity always can be transparent converted for a nullable column
- **database** as *string*, **required**, no default

SQLite database path.

- **updatable** as *boolean*, optional, default *true*

This option allow or disallow write operations on SQLite database file.

- **truncatable** as *boolean*, optional, default *true*

Allows foreign tables to be truncated using the `TRUNCATE` command.

- **keep_connections** as *boolean*, optional, default *true*

Allows to keep connections to SQLite while there is no SQL operations between PostgreSQL and SQLite.

- **batch_size** as *integer*, optional, default *1*

Specifies the number of rows which should be inserted in a single `INSERT` operation. This setting can be overridden for individual tables.
Expand All @@ -203,17 +203,17 @@ In OS `sqlite_fdw` works as executed code with permissions of user of PostgreSQL
SQLite table name. Use if not equal to name of foreign table in PostgreSQL. Also see about [identifier case handling](#identifier-case-handling).

- **truncatable** as *boolean*, optional, default from the same `CREATE SERVER` option

See `CREATE SERVER` options section for details.

- **batch_size** as *integer*, optional, default from the same `CREATE SERVER` option

See `CREATE SERVER` options section for details.

- **updatable** as *boolean*, optional, default *true*

This option can allow or disallow write operations on a SQLite table independed of the same server option.

`sqlite_fdw` accepts the following column-level options via the
`CREATE FOREIGN TABLE` command:

Expand All @@ -225,7 +225,7 @@ In OS `sqlite_fdw` works as executed code with permissions of user of PostgreSQL

Set preferred SQLite affinity for some PostgreSQL data types can be stored in different ways
in SQLite (mixed affinity case). Updated and inserted values will have this affinity. Default preferred SQLite affinity for `timestamp` and `uuid` PostgreSQL data types is `text`.

- Use `INT` value for SQLite column (epoch Unix Time) to be treated/visualized as `timestamp` in PostgreSQL.
- Use `BLOB` value for SQLite column to be treated/visualized as `uuid` in PostgreSQL 14+.

Expand Down Expand Up @@ -327,7 +327,7 @@ with names composed from ASCII base latin letters *only*.
CREATE TABLE T_dia (
"Ä" INTEGER,
"ä" NUMERIC
);
);
```

For SQLite there is no difference between
Expand All @@ -340,7 +340,7 @@ For SQLite there is no difference between
```
For PostgreSQL the query with comment `№4` is independend query to table `T`, not to table `t` as other queries.
Please note this table name composed from ASCII base latin letters *only*. This is not applicable for other
alphabet systems or mixed names. This is because `toLower` operation in PostgreSQL is Unicode opration but
alphabet systems or mixed names. This is because `toLower` operation in PostgreSQL is Unicode opration but
ASCII only operation in SQLite, hence other characters will not be changed.

```sql
Expand Down
4 changes: 1 addition & 3 deletions sqlite_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ get_column_option_string(Oid relid, int varattno, char *optionname)
foreach(lc, options)
{
DefElem *def = (DefElem *) lfirst(lc);

if (strcmp(def->defname, optionname) == 0)
{
coloptionvalue = defGetString(def);
Expand Down Expand Up @@ -580,7 +579,6 @@ sqlite_bind_sql_var(Form_pg_attribute att, int attnum, Datum value, sqlite3_stmt
case UUIDOID:
{
bool uuid_as_blob = false;

if (relid)
{
char * optv = get_column_option_string (relid, attnum, "column_type");
Expand Down Expand Up @@ -778,7 +776,7 @@ sqlite_numeric_overflow (Form_pg_attribute att, sqlite3_stmt * stmt, int stmt_co
NameData pgColND = att->attname;
const char *pg_dataTypeName = 0;
const unsigned char *text_value = sqlite3_column_text(stmt, stmt_colid);

pg_dataTypeName = TypeNameToString(makeTypeNameFromOid(pgtyp, pgtypmod));
ereport(ERROR, (errcode(ERRCODE_FDW_INVALID_DATA_TYPE),
errmsg("Out of range for data type \"%s\"", pg_dataTypeName),
Expand Down

0 comments on commit 3835967

Please sign in to comment.