On Thu, Apr 17, 2014 at 12:46 PM, Bruce Momjian <br...@momjian.us> wrote:
>
> On Thu, Apr 17, 2014 at 11:44:37AM -0400, Tom Lane wrote:
> > Bruce Momjian <br...@momjian.us> writes:
> > > The idea is that we only need quotes when there are odd characters in
> > > the identifier.  We do that right now in some places, though I can't
> > > find them in pg_dump.  I know psql does that, see quote_ident().
> >
> > I think our general style rule is that identifiers embedded in messages
> > are always double-quoted.  There's an exception for type names, but
> > not otherwise.  You're confusing the message case with printing SQL.
>
> OK.  I was unclear if a status _display_ was a message like an error
> message.
>

The attached patch fix missing double-quoted in "dumping contents of
table.." message and add schema name to other messages:
- "reading indexes for table \"%s\".\"%s\"\n"
- "reading foreign key constraints for table \"%s\".\"%s\"\n"
- "reading triggers for table \"%s\".\"%s\"\n"
- "finding the columns and types of table \"%s\".\"%s\"\n"
- "finding default expressions of table \"%s\".\"%s\"\n"
- "finding check constraints for table \"%s\".\"%s\"\n"

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index 9464540..7f73e8d 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -706,8 +706,8 @@ restore_toc_entry(ArchiveHandle *AH, TocEntry *te,
 					_becomeOwner(AH, te);
 					_selectOutputSchema(AH, te->namespace);
 
-					ahlog(AH, 1, "processing data for table \"%s\"\n",
-						  te->tag);
+					ahlog(AH, 1, "processing data for table \"%s\".\"%s\"\n",
+						  AH->currSchema, te->tag);
 
 					/*
 					 * In parallel restore, if we created the table earlier in
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index a6c0428..78ec5bf 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -1400,7 +1400,17 @@ dumpTableData_copy(Archive *fout, void *dcontext)
 	const char *column_list;
 
 	if (g_verbose)
-		write_msg(NULL, "dumping contents of table %s\n", classname);
+	{
+		/* Print namespace information if available */
+		if (tbinfo->dobj.namespace != NULL &&
+			tbinfo->dobj.namespace->dobj.name != NULL)
+			write_msg(NULL, "dumping contents of table \"%s\".\"%s\"\n",
+					  tbinfo->dobj.namespace->dobj.name,
+					  classname);
+		else
+			write_msg(NULL, "dumping contents of table \"%s\"\n",
+					  classname);
+	}
 
 	/*
 	 * Make sure we are in proper schema.  We will qualify the table name
@@ -4974,8 +4984,17 @@ getIndexes(Archive *fout, TableInfo tblinfo[], int numTables)
 			continue;
 
 		if (g_verbose)
-			write_msg(NULL, "reading indexes for table \"%s\"\n",
-					  tbinfo->dobj.name);
+		{
+			/* Print namespace information if available */
+			if (tbinfo->dobj.namespace != NULL &&
+				tbinfo->dobj.namespace->dobj.name != NULL)
+				write_msg(NULL, "reading indexes for table \"%s\".\"%s\"\n",
+						  tbinfo->dobj.namespace->dobj.name,
+						  tbinfo->dobj.name);
+			else
+				write_msg(NULL, "reading indexes for table \"%s\"\n",
+						  tbinfo->dobj.name);
+		}
 
 		/* Make sure we are in proper schema so indexdef is right */
 		selectSourceSchema(fout, tbinfo->dobj.namespace->dobj.name);
@@ -5340,8 +5359,17 @@ getConstraints(Archive *fout, TableInfo tblinfo[], int numTables)
 			continue;
 
 		if (g_verbose)
-			write_msg(NULL, "reading foreign key constraints for table \"%s\"\n",
-					  tbinfo->dobj.name);
+		{
+			/* Print namespace information if available */
+			if (tbinfo->dobj.namespace != NULL &&
+				tbinfo->dobj.namespace->dobj.name != NULL)
+				write_msg(NULL, "reading foreign key constraints for table \"%s\".\"%s\"\n",
+						  tbinfo->dobj.namespace->dobj.name,
+						  tbinfo->dobj.name);
+			else
+				write_msg(NULL, "reading foreign key constraints for table \"%s\"\n",
+						  tbinfo->dobj.name);
+		}
 
 		/*
 		 * select table schema to ensure constraint expr is qualified if
@@ -5678,8 +5706,17 @@ getTriggers(Archive *fout, TableInfo tblinfo[], int numTables)
 			continue;
 
 		if (g_verbose)
-			write_msg(NULL, "reading triggers for table \"%s\"\n",
-					  tbinfo->dobj.name);
+		{
+			/* Print namespace information if available */
+			if (tbinfo->dobj.namespace != NULL &&
+				tbinfo->dobj.namespace->dobj.name != NULL)
+				write_msg(NULL, "reading triggers for table \"%s\".\"%s\"\n",
+						  tbinfo->dobj.namespace->dobj.name,
+						  tbinfo->dobj.name);
+			else
+				write_msg(NULL, "reading triggers for table \"%s\"\n",
+						  tbinfo->dobj.name);
+		}
 
 		/*
 		 * select table schema to ensure regproc name is qualified if needed
@@ -6291,8 +6328,17 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
 		 * the output of an indexscan on pg_attribute_relid_attnum_index.
 		 */
 		if (g_verbose)
-			write_msg(NULL, "finding the columns and types of table \"%s\"\n",
-					  tbinfo->dobj.name);
+		{
+			/* Print namespace information if available */
+			if (tbinfo->dobj.namespace != NULL &&
+				tbinfo->dobj.namespace->dobj.name != NULL)
+				write_msg(NULL, "finding the columns and types of table \"%s\".\"%s\"\n",
+							  tbinfo->dobj.namespace->dobj.name,
+							  tbinfo->dobj.name);
+			else
+				write_msg(NULL, "finding the columns and types of table \"%s\"\n",
+						  tbinfo->dobj.name);
+		}
 
 		resetPQExpBuffer(q);
 
@@ -6503,8 +6549,17 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
 			int			numDefaults;
 
 			if (g_verbose)
-				write_msg(NULL, "finding default expressions of table \"%s\"\n",
-						  tbinfo->dobj.name);
+			{
+				/* Print namespace information if available */
+				if (tbinfo->dobj.namespace != NULL &&
+					tbinfo->dobj.namespace->dobj.name != NULL)
+					write_msg(NULL, "finding default expressions of table \"%s\".\"%s\"\n",
+								  tbinfo->dobj.namespace->dobj.name,
+								  tbinfo->dobj.name);
+				else
+					write_msg(NULL, "finding default expressions of table \"%s\"\n",
+							  tbinfo->dobj.name);
+			}
 
 			resetPQExpBuffer(q);
 			if (fout->remoteVersion >= 70300)
@@ -6627,8 +6682,17 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
 			int			numConstrs;
 
 			if (g_verbose)
-				write_msg(NULL, "finding check constraints for table \"%s\"\n",
-						  tbinfo->dobj.name);
+			{
+				/* Print namespace information if available */
+				if (tbinfo->dobj.namespace != NULL &&
+					tbinfo->dobj.namespace->dobj.name != NULL)
+					write_msg(NULL, "finding check constraints for table \"%s\".\"%s\"\n",
+								  tbinfo->dobj.namespace->dobj.name,
+								  tbinfo->dobj.name);
+				else
+					write_msg(NULL, "finding check constraints for table \"%s\"\n",
+							  tbinfo->dobj.name);
+			}
 
 			resetPQExpBuffer(q);
 			if (fout->remoteVersion >= 90200)
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to