Re: remove unneeded pstrdup in fetch_table_list

2021-01-15 Thread Amit Kapila
On Thu, Jan 14, 2021 at 3:05 PM Amit Kapila wrote: > > On Thu, Jan 14, 2021 at 10:51 AM Tom Lane wrote: > > > > Michael Paquier writes: > > > On Thu, Jan 14, 2021 at 01:17:57AM +, Hou, Zhijie wrote: > > Thanks. I am thinking to backpatch this even though there is no > > problem rep

Re: remove unneeded pstrdup in fetch_table_list

2021-01-14 Thread Amit Kapila
On Thu, Jan 14, 2021 at 10:51 AM Tom Lane wrote: > > Michael Paquier writes: > > On Thu, Jan 14, 2021 at 01:17:57AM +, Hou, Zhijie wrote: > Thanks. I am thinking to backpatch this even though there is no > problem reported from any production system. What do you think? > > > text_to

Re: remove unneeded pstrdup in fetch_table_list

2021-01-13 Thread Tom Lane
Michael Paquier writes: > On Thu, Jan 14, 2021 at 01:17:57AM +, Hou, Zhijie wrote: Thanks. I am thinking to backpatch this even though there is no problem reported from any production system. What do you think? > text_to_cstring() indeed allocates a new string, so the extra > alloca

Re: remove unneeded pstrdup in fetch_table_list

2021-01-13 Thread Michael Paquier
On Thu, Jan 14, 2021 at 01:17:57AM +, Hou, Zhijie wrote: >>> Thanks. I am thinking to backpatch this even though there is no >>> problem reported from any production system. What do you think? >> >> No objections from me. > > +1 text_to_cstring() indeed allocates a new string, so the extra a

RE: remove unneeded pstrdup in fetch_table_list

2021-01-13 Thread Hou, Zhijie
> >>> Your observation seems correct to me, though I have not tried to > >>> test your patch. > >> > >> +1 to apply, this looks correct and passes tests. Scanning around I > >> +didn't see > >> any other occurrences of the same pattern. > > > > Thanks. I am thinking to backpatch this even though t

Re: remove unneeded pstrdup in fetch_table_list

2021-01-13 Thread Daniel Gustafsson
> On 13 Jan 2021, at 14:09, Amit Kapila wrote: > > On Wed, Jan 13, 2021 at 2:55 PM Daniel Gustafsson wrote: >> >>> On 13 Jan 2021, at 07:10, Amit Kapila wrote: >> >>> Your observation seems correct to me, though I have not tried to test >>> your patch. >> >> +1 to apply, this looks correct a

Re: remove unneeded pstrdup in fetch_table_list

2021-01-13 Thread Amit Kapila
On Wed, Jan 13, 2021 at 2:55 PM Daniel Gustafsson wrote: > > > On 13 Jan 2021, at 07:10, Amit Kapila wrote: > > > Your observation seems correct to me, though I have not tried to test > > your patch. > > +1 to apply, this looks correct and passes tests. Scanning around I didn't > see > any othe

Re: remove unneeded pstrdup in fetch_table_list

2021-01-13 Thread Daniel Gustafsson
> On 13 Jan 2021, at 07:10, Amit Kapila wrote: > Your observation seems correct to me, though I have not tried to test > your patch. +1 to apply, this looks correct and passes tests. Scanning around I didn't see any other occurrences of the same pattern. cheers ./daniel

Re: remove unneeded pstrdup in fetch_table_list

2021-01-12 Thread Amit Kapila
On Wed, Jan 13, 2021 at 8:11 AM Hou, Zhijie wrote: > > Hi > > In function fetch_table_list, it get the table names from publicer and return > a list of tablenames. > When append the name to the list, it use the following code: > > ** > nspname = TextDatumGetCString(slot_getattr(slot, 1, &

remove unneeded pstrdup in fetch_table_list

2021-01-12 Thread Hou, Zhijie
Hi In function fetch_table_list, it get the table names from publicer and return a list of tablenames. When append the name to the list, it use the following code: ** nspname = TextDatumGetCString(slot_getattr(slot, 1, &isnull)); Assert(!isnull); relname = TextDatumGetCSt