duckdb / postgres_scanner

MIT License
194 stars 35 forks source link

Allow synchronous snapshot on replicas and in RDS/Aurora #235

Open bdavisab opened 1 month ago

bdavisab commented 1 month ago

Synchronized snapshots are supported on replicas starting with PostgreSQL 10, and they're also supported in RDS/Aurora.

The change in Postgres 10 didn't make it into the release notes, but I found this https://github.com/postgres/postgres/blob/master/src/bin/pg_dump/pg_dump.c#L1343

Postgres 9.6 is super old now, even 10 and 11 aren't supported anymore, and 12 will be EOL in November. So I think it's reasonable to simply drop the version checks. But we can keep the guards in too if you prefer, happy to update.

Tested with an Aurora replica, and that works just fine as well.

It's true that in https://github.com/duckdb/postgres_scanner/issues/134 , pg_stat_get_wal_receiver() isn't supported in Aurora, but that's just used to check if it's a replica or not, which since PG10, we don't need to worry about.

I assume that the people reporting this issue https://github.com/duckdb/postgres_scanner/issues/90 were just using ancient versions of Postgres. Maybe that's an argument for keeping a version check? Let me know what you think.