sqlite_fdw
sqlite_fdw : SQLite Foreign Data Wrapper
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 8640 | sqlite_fdw | sqlite_fdw | 2.5.0 |
FDW | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | duckdb_fdw pglite_fusion omni_sqlite mysql_fdw oracle_fdw tds_fdw db2_fdw informix_fdw postgres_fdw firebird_fdw |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PGDG | 2.5.0 |
18 17 16 15 14 | sqlite_fdw |
- |
| RPM | PGDG | 2.5.0 |
18 17 16 15 14 | sqlite_fdw_$v |
- |
| DEB | PIGSTY | 2.5.0 |
18 17 16 15 14 | postgresql-$v-sqlite-fdw |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 2.5.0 | PGDG 2.4.0 | PGDG 2.4.0 | PGDG 2.4.0 | PGDG 2.4.0 |
| el8.aarch64 | PIGSTY 2.5.0 | PGDG 2.4.0 | PGDG 2.4.0 | PGDG 2.4.0 | PGDG 2.4.0 |
| el9.x86_64 | PIGSTY 2.5.0 | PGDG 2.5.0 | PGDG 2.5.0 | PGDG 2.5.0 | PGDG 2.5.0 |
| el9.aarch64 | PIGSTY 2.5.0 | PGDG 2.5.0 | PGDG 2.5.0 | PGDG 2.5.0 | PGDG 2.5.0 |
| el10.x86_64 | PIGSTY 2.5.0 | PGDG 2.5.0 | PGDG 2.5.0 | PGDG 2.5.0 | PGDG 2.5.0 |
| el10.aarch64 | PIGSTY 2.5.0 | PGDG 2.5.0 | PGDG 2.5.0 | PGDG 2.5.0 | PGDG 2.5.0 |
| d12.x86_64 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 |
| d12.aarch64 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 |
| d13.x86_64 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 |
| d13.aarch64 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 |
| u22.x86_64 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 |
| u22.aarch64 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 |
| u24.x86_64 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 |
| u24.aarch64 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 |
| u26.x86_64 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 |
| u26.aarch64 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 | PIGSTY 2.5.0 |
Source
github.com/pgspider/sqlite_fdw
sqlite_fdw-2.5.0.tar.gz
Install
Make sure PGDG repo available:
Install this extension with pig:
Create this extension with:
Usage
Create Server
Server Options: database (required, path to SQLite file), updatable (default true), truncatable (default false), keep_connections (default true), batch_size (default 1), force_readonly (default false).
No CREATE USER MAPPING is required since SQLite has no authentication model.
Create Foreign Table
Table Options: table (SQLite table name if different from PostgreSQL name), updatable, truncatable, batch_size.
Column Options: column_name (map to different SQLite column name), column_type (SQLite affinity: INT for epoch timestamps, BLOB for UUIDs), key (mark as primary key for UPDATE/DELETE).
CRUD Operations
Import Foreign Schema
Import Options: import_default (default false), import_not_null (default true).
Data Type Mapping
| SQLite Type | PostgreSQL Type |
|---|---|
| int | bigint |
| text, char, clob | text |
| blob | bytea |
| real, float, double | double precision |
| datetime | timestamp |
| uuid | uuid |
| json, jsonb | json, jsonb |
Timestamps can be stored as TEXT (ISO format) or INT (Unix epoch, use column_type 'INT'). UUIDs can be stored as TEXT (36 chars) or BLOB (16 bytes). The SQLite database file must be readable (and writable for DML) by the PostgreSQL OS user.