gleu/sqlite_fdw

Blob column are only 3 bytes

Opened this issue · 0 comments

I have a sqlite database with blob columns. When I run the following query in sqlite, I'm seeing sizes around 1900

SELECT length(tile_data) from tiles limit 100;

After creating the foreign table, when I execute the corresponding query in postgres, every row is returning 3. Is this a problem with how I created the foreign table or is it a limitation of the sqlite_fdw?

SELECT octet_length(tile_data) from foreign_tiles limit 100;

The create table statement was something like the following (just removed the other column definitions to simplify it)

CREATE FOREIGN TABLE foreign_tiles (
tile_data bytea
) SERVER sqlite_server OPTIONS (table 'tiles')

NOTE: I confirmed that the issue remains even if I use IMPORT FOREIGN SCHEMA to bring the tables in.