From: Craig Ringer Date: Tue, 21 Apr 2015 10:52:08 +0000 (+0800) Subject: Rename 'bdr' reserved db to 'bdr_supervisordb' X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=1f0ab1e4668822ce41fc393876eed54d9707c1de;p=2ndquadrant_bdr.git Rename 'bdr' reserved db to 'bdr_supervisordb' --- diff --git a/bdr.h b/bdr.h index 76e9b1b385..4f37d3fd1b 100644 --- a/bdr.h +++ b/bdr.h @@ -51,6 +51,7 @@ #define BDR_DUMP_CMD "pg_dump" #endif +#define BDR_SUPERVISOR_DBNAME "bdr_supervisordb" /* * Don't include libpq here, msvc infrastructure requires linking to libpq diff --git a/bdr_supervisor.c b/bdr_supervisor.c index 6c1a119970..25cce638eb 100644 --- a/bdr_supervisor.c +++ b/bdr_supervisor.c @@ -263,7 +263,7 @@ bdr_supervisor_createdb() StartTransactionCommand(); /* If the DB already exists, no need to create it */ - dboid = get_database_oid("bdr", true); + dboid = get_database_oid(BDR_SUPERVISOR_DBNAME, true); if (dboid == InvalidOid) { @@ -279,21 +279,21 @@ bdr_supervisor_createdb() de_template.type = T_Integer; de_connlimit.arg = (Node*) makeInteger(1); - stmt.dbname = "bdr"; + stmt.dbname = BDR_SUPERVISOR_DBNAME; stmt.options = list_make2(&de_template, &de_connlimit); dboid = createdb(&stmt); if (dboid == InvalidOid) - elog(ERROR, "Failed to create 'bdr' DB"); + elog(ERROR, "Failed to create "BDR_SUPERVISOR_DBNAME" DB"); /* TODO DYNCONF: Add a comment to the db, and/or a dummy table */ - elog(LOG, "Created database 'bdr' (oid=%i) during BDR startup", dboid); + elog(LOG, "Created database "BDR_SUPERVISOR_DBNAME" (oid=%i) during BDR startup", dboid); } else { - elog(DEBUG3, "Database 'bdr' (oid=%i) already exists, not creating", dboid); + elog(DEBUG3, "Database "BDR_SUPERVISOR_DBNAME" (oid=%i) already exists, not creating", dboid); } CommitTransactionCommand(); @@ -331,8 +331,10 @@ bdr_supervisor_worker_main(Datum main_arg) * can be accessed before being connected to a database - and * pg_shseclabel is not one of those. * - * Instead we have a database "bdr" that's supposed to be empty which we - * just use to read pg_shseclabel. Not pretty, but it works. + * Instead we have a database BDR_SUPERVISOR_DBNAME that's supposed to + * be empty which we just use to read pg_shseclabel. Not pretty, but it + * works. (The need for this goes away in 9.5 with the new oid-based + * alternative bgworker api). * * Without copying significant parts of InitPostgres() we can't even read * pg_database without connecting to a database. As we can't connect to @@ -353,13 +355,13 @@ bdr_supervisor_worker_main(Datum main_arg) proc_exit(1); } - BackgroundWorkerInitializeConnection("bdr", NULL); + BackgroundWorkerInitializeConnection(BDR_SUPERVISOR_DBNAME, NULL); LWLockAcquire(BdrWorkerCtl->lock, LW_EXCLUSIVE); BdrWorkerCtl->supervisor_latch = &MyProc->procLatch; LWLockRelease(BdrWorkerCtl->lock); - elog(DEBUG1, "BDR supervisor connected to DB 'bdr'"); + elog(DEBUG1, "BDR supervisor connected to DB "BDR_SUPERVISOR_DBNAME); SetConfigOption("application_name", "bdr supervisor", PGC_USERSET, PGC_S_SESSION);