From 528db06c7f0ad4a5b4ba3469fed885a0903505bb Mon Sep 17 00:00:00 2001 From: Alex Kasko Date: Fri, 29 Sep 2023 22:41:18 +0100 Subject: [PATCH] Check that db is selected before loading babelfishpg_tsql Signed-off-by: Alex Kasko --- src/backend/tcop/postgres.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 6b4fc771185..48f856ee11e 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -4270,7 +4270,7 @@ PostgresMain(const char *dbname, const char *username) */ start_xact_command(); PushActiveSnapshot(GetTransactionSnapshot()); - if (get_extension_oid(pgtsql_library_name, true) != InvalidOid) + if (OidIsValid(MyDatabaseId) && OidIsValid(get_extension_oid(pgtsql_library_name, true))) { /* * babelfishpg_tsql extension depends on babelfishpg_common, so