Skip to content

Commit

Permalink
Check that db is selected before loading babelfishpg_tsql
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Kasko <[email protected]>
  • Loading branch information
staticlibs committed Oct 23, 2023
1 parent a43212e commit 528db06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/tcop/postgres.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 528db06

Please sign in to comment.