Skip to content

Commit

Permalink
Support databasepropertyex for rdsadmin db
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharath BP committed Sep 25, 2024
1 parent 5dee751 commit e4124af
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions contrib/babelfishpg_tsql/src/databasepropertyex.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ databasepropertyex(PG_FUNCTION_ARGS)
int64_t intVal = 0;
const char *dbname = text_to_cstring(PG_GETARG_TEXT_P(0));
const char *property = text_to_cstring(PG_GETARG_TEXT_P(1));
Oid dboid = get_db_id(dbname);
Oid dboid = 0;
if(strcmp(dbname, "rdsadmin") == 0)
{
dbname = "master";
}
dboid = get_db_id(dbname);

if (dboid == InvalidOid)
{
Expand Down Expand Up @@ -210,7 +215,7 @@ databasepropertyex(PG_FUNCTION_ARGS)
{
const char *ret = "READ_WRITE";

if (strcmp(GetConfigOption("transaction_read_only", false, false), "on") == 0)
if (strcmp(GetConfigOption("transaction_read_only", true, false), "on") == 0)
{
ret = "READ_ONLY";
}
Expand Down

0 comments on commit e4124af

Please sign in to comment.