Missing newlines in verbose logs of pg_dump, introduced by RLS patch

Started by Michael Paquierover 11 years ago5 messages
#1Michael Paquier
michael.paquier@gmail.com
1 attachment(s)

Hi all,

Recent commit 491c029 introducing RLS has broken a bit the verbose logs of
pg_dump, one message missing a newline:
+               if (g_verbose)
+                       write_msg(NULL, "reading row-security enabled for
table \"%s\"",
+                                         tbinfo->dobj.name);
The patch attached corrects that.
Regards,
-- 
Michael

Attachments:

20140928_rls_pgdump_fix.patchapplication/octet-stream; name=20140928_rls_pgdump_fix.patchDownload
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 12811a8..076ff8d 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -2803,7 +2803,7 @@ getRowSecurity(Archive *fout, TableInfo tblinfo[], int numTables)
 			continue;
 
 		if (g_verbose)
-			write_msg(NULL, "reading row-security enabled for table \"%s\"",
+			write_msg(NULL, "reading row-security enabled for table \"%s\"\n",
 					  tbinfo->dobj.name);
 
 		/*
#2Fabrízio de Royes Mello
fabriziomello@gmail.com
In reply to: Michael Paquier (#1)
1 attachment(s)
Re: Missing newlines in verbose logs of pg_dump, introduced by RLS patch

On Sun, Sep 28, 2014 at 1:36 AM, Michael Paquier <michael.paquier@gmail.com>
wrote:

Hi all,

Recent commit 491c029 introducing RLS has broken a bit the verbose logs

of pg_dump, one message missing a newline:

+               if (g_verbose)
+                       write_msg(NULL, "reading row-security enabled for

table \"%s\"",

+ tbinfo->dobj.name);
The patch attached corrects that.

The schema name is missing... attached patch add it.

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL

Show quoted text

Timbira: http://www.timbira.com.br
Blog: http://fabriziomello.github.io
Linkedin: http://br.linkedin.com/in/fabriziomello
Twitter: http://twitter.com/fabriziomello
Github: http://github.com/fabriziomello

Attachments:

pgdump_verbose_msg_fix_v1.patchtext/x-diff; charset=US-ASCII; name=pgdump_verbose_msg_fix_v1.patchDownload
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 12811a8..ab169c9 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -2803,8 +2803,8 @@ getRowSecurity(Archive *fout, TableInfo tblinfo[], int numTables)
 			continue;
 
 		if (g_verbose)
-			write_msg(NULL, "reading row-security enabled for table \"%s\"",
-					  tbinfo->dobj.name);
+			write_msg(NULL, "reading row-security enabled for table \"%s\".\"%s\"\n",
+					  tbinfo->dobj.namespace->dobj.name, tbinfo->dobj.name);
 
 		/*
 		 * Get row-security enabled information for the table.
@@ -2833,8 +2833,8 @@ getRowSecurity(Archive *fout, TableInfo tblinfo[], int numTables)
 		}
 
 		if (g_verbose)
-			write_msg(NULL, "reading row-security policies for table \"%s\"\n",
-					  tbinfo->dobj.name);
+			write_msg(NULL, "reading row-security policies for table \"%s\".\"%s\"\n",
+					  tbinfo->dobj.namespace->dobj.name, tbinfo->dobj.name);
 
 		/*
 		 * select table schema to ensure regproc name is qualified if needed
#3Michael Paquier
michael.paquier@gmail.com
In reply to: Fabrízio de Royes Mello (#2)
Re: Missing newlines in verbose logs of pg_dump, introduced by RLS patch

On Mon, Sep 29, 2014 at 10:07 AM, Fabrízio de Royes Mello <
fabriziomello@gmail.com> wrote:

The schema name is missing... attached patch add it.

Ah, right, thanks. It didn't occur to me immediately :) Your patch looks
good to me, and you are updating as well the second message that missed the
schema name in getRowSecurity.
Regards,
--
Michael

#4Stephen Frost
sfrost@snowman.net
In reply to: Michael Paquier (#3)
Re: Missing newlines in verbose logs of pg_dump, introduced by RLS patch

* Michael Paquier (michael.paquier@gmail.com) wrote:

On Mon, Sep 29, 2014 at 10:07 AM, Fabrízio de Royes Mello <
fabriziomello@gmail.com> wrote:

The schema name is missing... attached patch add it.

Ah, right, thanks. It didn't occur to me immediately :) Your patch looks
good to me, and you are updating as well the second message that missed the
schema name in getRowSecurity.

Thanks to you both- will review.

Thanks again,

Stephen

#5Stephen Frost
sfrost@snowman.net
In reply to: Stephen Frost (#4)
Re: Missing newlines in verbose logs of pg_dump, introduced by RLS patch

* Stephen Frost (sfrost@snowman.net) wrote:

* Michael Paquier (michael.paquier@gmail.com) wrote:

On Mon, Sep 29, 2014 at 10:07 AM, Fabrízio de Royes Mello <
fabriziomello@gmail.com> wrote:

The schema name is missing... attached patch add it.

Ah, right, thanks. It didn't occur to me immediately :) Your patch looks
good to me, and you are updating as well the second message that missed the
schema name in getRowSecurity.

Thanks to you both- will review.

Fix pushed- thanks!

Stephen