Hi All! We have Postgreql source databases that a...
# help-connector-development
w
Hi All! We have Postgreql source databases that are running in SQL_ASCII encoding and have some number of tables with non-UTF8 compatible characters. I believe I've discovered that the JDBC driver used by the primary Airbyte Postgreql doesn't support us connecting to the source using SQL_ASCII client encoding. We are interested in pursuing the posibility of creating a custom connector that will allow us to connect to Postgreql without using a JDBC Driver. Does anyone out here in slack world have any experience or knowledge in how possible this might be? I'd love to be able to learn from your mistakes before we head off on what might be a difficult path. Thanks!
p
w
The error in Airbyte we get is : [22021] ERROR: invalid byte sequence for encoding "UTF8": 0xff I've connected to the same database with dbeaver and tried to set client encoding to SQL_ASCII and have gotten the error in the screenshot. We can certainly try it in Airbyte to confirm the same error.
p
I've also found
allowEncodingChanges
in connection parameters https://jdbc.postgresql.org/documentation/use/ I guess this might be the last try.
w
Yup. I saw that too... and it seemed to say that we shouldn't change it.
Thanks for your help @Przemysław Dąbek, we've tried to add both parameters and they give us the same error as in the screen shot.
p
I reproduced this error also on my local machine with no luck with parameters
Do you think it would be possible to create views for your tables that provide base64-encoded version of your data?
Copy code
CREATE VIEW table_base64 AS
SELECT
  encode(convert_to(column, 'SQL_ASCII'), 'base64')
  -- more columns ...
FROM table;
It would require decoding in destination, but I think it might work with existing connector
w
Won't views prevent us from using CDC or Incremental Extractions?
p
https://docs.airbyte.com/integrations/sources/postgres#limitations--troubleshooting https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting#cdc-requirements
CDC Requirements
• Data must be in tables and not views. If you require data synchronization from a view, you would need to create a new connection with
Standard
as
Replication Method
.
Workaround for this idea with the view would be a table with duplicated and converted + trigger on insert/update/delete, but it would use ~twice as much storage
I guess writing a new connector might be a good idea in this case. What programming language are you going to use?
w
Yeah, we are trying to avoid making changes to the source system.. it's a bit of a long process. I'm pretty sure we are using python.
yup, Python