2 ms·
Co-founder here. The 63-char limit still applies (we didn't recompile Postgres!) but we have some code in front, embedded in a layer of PgBouncers, that interce
by mildbyte 6y ago
Co-founder here. The 63-char limit still applies (we didn't recompile Postgres!) but we have some code in front, embedded in a layer of PgBouncers, that intercepts the query, parses it and rewrites it into a shorter dataset ID hash that we then "mount" on the database on the fly using Postgres FDWs before forwarding it.
We also use this to drop unwanted queries and rewrite clients' introspection queries (e.g. information_schema.tables) to give them a list of featured datasets instead of normal Postgres schema names.
- marton78 6y agoNice! And how do you parse SQL? Do you use Postgres's parser or did you have to implement one yourself?
- mildbyte 6y agoWe use pglast [0]: it's basically a Python wrapper around Postgres's query parsing code. [0] https://github.com/lelit/pglast https://github.com/lelit/pglast
- jarym 6y agoFascinating and impressive - nice work and nice solution until the day comes where the identifier length is increased by default