[HACKERS] dump a comment of a TSDictionary - Mailing list pgsql-hackers

From Giuseppe Broccolo
Subject [HACKERS] dump a comment of a TSDictionary
Date
Msg-id CAFzmHiWwwzLjzwM4x5ki5s_PDMR6NrkipZkjNnO3B0xEpBgJaA@mail.gmail.com
Whole thread Raw
Responses Re: [HACKERS] dump a comment of a TSDictionary  (Stephen Frost <sfrost@snowman.net>)
Re: [HACKERS] dump a comment of a TSDictionary  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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.broccolo@2ndQuadrant.it | www.2ndQuadrant.it

pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: [HACKERS] One-shot expanded output in psql using \gx
Next
From: Dilip Kumar
Date:
Subject: Re: [HACKERS] Proposal : Parallel Merge Join