Skip to content

Commit 1cff5e8

Browse files
EDsCODEclaude
andcommitted
Add PostgreSQL-compatible version() function
PostgreSQL clients call SELECT version() to check database compatibility. DuckDB's native version() returns "v1.1.0 ..." which doesn't match PostgreSQL format. This adds a macro that overrides version() to return a PostgreSQL-compatible string: "PostgreSQL 15.0 on x86_64-pc-linux-gnu, compiled by gcc, 64-bit (Duckgres/DuckDB)" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 004d82e commit 1cff5e8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/catalog.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@ func initPgCatalog(db *sql.DB) error {
270270
END`,
271271
// pg_is_in_recovery - check if in recovery mode
272272
`CREATE OR REPLACE MACRO pg_is_in_recovery() AS false`,
273+
// version - return PostgreSQL-compatible version string
274+
// Fivetran and other tools check this to determine compatibility
275+
`CREATE OR REPLACE MACRO version() AS 'PostgreSQL 15.0 on x86_64-pc-linux-gnu, compiled by gcc, 64-bit (Duckgres/DuckDB)'`,
273276
}
274277

275278
for _, f := range functions {

0 commit comments

Comments
 (0)