pg-redis-fdw / redis_fdw

A PostgreSQL foreign data wrapper for Redis
497 stars 68 forks source link

Null bytes in redis bit strings #29

Open nowwireless-andy opened 3 years ago

nowwireless-andy commented 3 years ago

I use SETBIT https://redis.io/commands/SETBIT to efficiently store second-by-second availability data for many devices. These are ultimately strings from redis's point of view.

I am looking to access this from pg and found this extension. I can access the data but if there is a strings of zeroes in the bitstring such that a null byte is returned, the extension views this as a string terminator and I don't get any further data for that key. I've tried creating the foreign table with a bytea type rather than a text type but this makes no difference. I looked in the options documentation for a binary option but didn't see one.

Am I doing something wrong, or is this not currently supported?