event trigger pg_dump fix

Started by Petr Jelinekabout 11 years ago3 messages
#1Petr Jelinek
petr@2ndquadrant.com
1 attachment(s)

Hi,

Attached is fix for
/messages/by-id/1420492505.23613.15.camel@bloodnok.com

It was dumping comment with NULL owner while the function expects
empty string for objects without owner (there is pg_strdup down the
line).

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachments:

pg_dump_evt_tigger_20150105.patchtext/x-patch; charset=US-ASCII; name=pg_dump_evt_tigger_20150105.patchDownload
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 6658fda..6541463 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -15106,7 +15106,7 @@ dumpEventTrigger(Archive *fout, DumpOptions *dopt, EventTriggerInfo *evtinfo)
 				 query->data, "", NULL, NULL, 0, NULL, NULL);
 
 	dumpComment(fout, dopt, labelq->data,
-				NULL, NULL,
+				NULL, "",
 				evtinfo->dobj.catId, 0, evtinfo->dobj.dumpId);
 
 	destroyPQExpBuffer(query);
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Petr Jelinek (#1)
Re: event trigger pg_dump fix

Petr Jelinek <petr@2ndquadrant.com> writes:

Attached is fix for
/messages/by-id/1420492505.23613.15.camel@bloodnok.com

It was dumping comment with NULL owner while the function expects
empty string for objects without owner (there is pg_strdup down the
line).

This isn't right either: event triggers do have owners.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Petr Jelinek
petr@2ndquadrant.com
In reply to: Tom Lane (#2)
1 attachment(s)
Re: event trigger pg_dump fix

On 06/01/15 01:02, Tom Lane wrote:

Petr Jelinek <petr@2ndquadrant.com> writes:

Attached is fix for
/messages/by-id/1420492505.23613.15.camel@bloodnok.com

It was dumping comment with NULL owner while the function expects
empty string for objects without owner (there is pg_strdup down the
line).

This isn't right either: event triggers do have owners.

Bah, of course, stupid me.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachments:

pg_dump_evt_tigger_20150106.patchtext/x-diff; name=pg_dump_evt_tigger_20150106.patchDownload
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 6658fda..00b87e7 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -15106,7 +15106,7 @@ dumpEventTrigger(Archive *fout, DumpOptions *dopt, EventTriggerInfo *evtinfo)
 				 query->data, "", NULL, NULL, 0, NULL, NULL);
 
 	dumpComment(fout, dopt, labelq->data,
-				NULL, NULL,
+				NULL, evtinfo->evtowner,
 				evtinfo->dobj.catId, 0, evtinfo->dobj.dumpId);
 
 	destroyPQExpBuffer(query);