*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup.h,v 1.52 2009/06/11 14:49:07 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup.h,v 1.53 2010/05/15 21:41:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
typedef struct _restoreOptions
{
- int create; /* Issue commands to create the database */
+ int createDB; /* Issue commands to create the database */
int noOwner; /* Don't try to match original object owner */
int noTablespace; /* Don't issue tablespace-related commands */
int disable_triggers; /* disable triggers during data-only
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.184 2010/04/23 23:21:44 rhaas Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.185 2010/05/15 21:41:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
/*
* Check for nonsensical option combinations.
*
- * NB: create+dropSchema is useless because if you're creating the DB,
+ * NB: createDB+dropSchema is useless because if you're creating the DB,
* there's no need to drop individual items in it. Moreover, if we tried
* to do that then we'd issue the drops in the database initially
* connected to, not the one we will create, which is very bad...
*/
- if (ropt->create && ropt->dropSchema)
+ if (ropt->createDB && ropt->dropSchema)
die_horribly(AH, modulename, "-C and -c are incompatible options\n");
/*
- * -1 is not compatible with -C, because we can't create a database inside
+ * -C is not compatible with -1, because we can't create a database inside
* a transaction block.
*/
- if (ropt->create && ropt->single_txn)
+ if (ropt->createDB && ropt->single_txn)
die_horribly(AH, modulename, "-C and -1 are incompatible options\n");
/*
ahprintf(AH, ";\n;\n; Selected TOC Entries:\n;\n");
+ /* We should print DATABASE entries whether or not -C was specified */
+ ropt->createDB = 1;
+
for (te = AH->toc->next; te != AH->toc; te = te->next)
{
if (ropt->verbose || _tocEntryRequired(te, ropt, true) != 0)
return 0;
/* Ignore DATABASE entry unless we should create it */
- if (!ropt->create && strcmp(te->desc, "DATABASE") == 0)
+ if (!ropt->createDB && strcmp(te->desc, "DATABASE") == 0)
return 0;
/* Check options for selective dump/restore */
* http://archives.postgresql.org/pgsql-bugs/2010-02/msg00187.php
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.579 2010/03/18 20:00:51 petere Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.580 2010/05/15 21:41:16 tgl Exp $
*
*-------------------------------------------------------------------------
*/
int compressLevel = -1;
int plainText = 0;
int outputClean = 0;
- int outputCreate = 0;
+ int outputCreateDB = 0;
bool outputBlobs = false;
int outputNoOwner = 0;
char *outputSuperuser = NULL;
break;
case 'C': /* Create DB */
- outputCreate = 1;
+ outputCreateDB = 1;
break;
case 'E': /* Dump encoding */
ropt->dropSchema = outputClean;
ropt->aclsSkip = aclsSkip;
ropt->superuser = outputSuperuser;
- ropt->create = outputCreate;
+ ropt->createDB = outputCreateDB;
ropt->noOwner = outputNoOwner;
ropt->noTablespace = outputNoTablespaces;
ropt->disable_triggers = disable_triggers;