Hi hackers,

I've seen that pg_dump execute the dump of an eventual comment of a
TSDictionary without
specifying the namespace where it is defined:

https://github.com/postgres/postgres/blob/master/src/bin/pg_dump/pg_dump.c#L13542

This is actually a problem if a new TSDictionary is created, in a different
schema specified by
the dumped search_path setting. I'd propose to change the current call in
src/bin/pg_dump/pg_dump.c:

dumpComment(fout, labelq->data,
                                           NULL, dictinfo->rolname,
                                           dictinfo->dobj.catId, 0,
dictinfo->dobj.dumpId);

with the following one:

dumpComment(fout, labelq->data,
                                           dictinfo->dobj.namespace->dobj.
name, dictinfo->rolname,
                                           dictinfo->dobj.catId, 0,
dictinfo->dobj.dumpId);

This is present in the master branch too, so potentially all the PostgreSQL
versions are affected.

Let me know what do you think about this change.

Regards,
Giuseppe.

-- 
Giuseppe Broccolo - 2ndQuadrant Italy
PostgreSQL & PostGIS Training, Services and Support
giuseppe.brocc...@2ndquadrant.it | www.2ndQuadrant.it

Reply via email to