Currently the documentation only shows using Postgres as a plugin. This uses the POSTGRES_SCANNER implementation of DuckDB, however using the Postgres extension as an attachment allows for both reading and writing. Though the current implementation of attachments in DuckDB seems to be intended for file-based attachments, this functionality works for postgres to using a Postgres DSN.
Potentially additional implementation changes can be made to either improve the attachment functionality or even remove the Postgres plugin in favour of the attachment implementation, but I'll leave that up to a discussion. For now I think a simple documentation change can save people a lot of headaches.
Currently the documentation only shows using Postgres as a plugin. This uses the
POSTGRES_SCANNER
implementation of DuckDB, however using the Postgres extension as an attachment allows for both reading and writing. Though the current implementation of attachments in DuckDB seems to be intended for file-based attachments, this functionality works for postgres to using a Postgres DSN.Potentially additional implementation changes can be made to either improve the attachment functionality or even remove the Postgres plugin in favour of the attachment implementation, but I'll leave that up to a discussion. For now I think a simple documentation change can save people a lot of headaches.