You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are planning to use Trino for syncing some tables from SQL Server to PostgreSQL - in the context of an ETL process.
We can always drop the table in Postgresql and re-insert all the data from SQL Server - and this is ok for medium-sized tables.
But for larger tables - we are trying to do a partial sync between the two tables using a last_updated column in the table.
The concept here is to delete all the records in PostgresSQL where the IDs last_updated column is older
deletefrompostgresql.public.t
where id in (
select id fromsqlserver.dbo.t
wheret.last_updated> (selectmax(last_updated) frompostgresql.public.t)
)
Should that delete worked - we were going to insert the updated rows.
This isn't supported today but it should be possible to implement.
@kokosing For more complex DELETE with base-jdbc did you already have some ideas of how it should look like? I assume it'll be modeled similar to Hive, i.e. each record would have a rowid column added and the PageSink/RecordSetProvider will selectively copy positions and drop the ones that are not needed?
We are planning to use Trino for syncing some tables from SQL Server to PostgreSQL - in the context of an ETL process.
We can always drop the table in Postgresql and re-insert all the data from SQL Server - and this is ok for medium-sized tables.
But for larger tables - we are trying to do a partial sync between the two tables using a
last_updated
column in the table.The concept here is to delete all the records in PostgresSQL where the IDs last_updated column is older
Should that delete worked - we were going to insert the updated rows.
The problem is that the above sql fragment raises the error
Unsupported delete
- most possibly refering to https://trino.io/docs/current/connector/postgresql.html#sql-deleteSo - is there a way to implement this partial sync between the two tables? Or must we always do massive truncates / re-insert the whole tables?
The text was updated successfully, but these errors were encountered: