Thread

Commits

  1. Fix misleading comment in pg_get_statisticsobjdef_string()

  1. mislead comments in pg_get_statisticsobjdef_string

    jian he <jian.universality@gmail.com> — 2025-09-25T13:16:47Z

    hi.
    
    /*
     * Internal version for use by ALTER TABLE.
     * Includes a tablespace clause in the result.
     * Returns a palloc'd C string; no pretty-printing.
     */
    char *
    pg_get_statisticsobjdef_string(Oid statextid)
    {
        return pg_get_statisticsobj_worker(statextid, false, false);
    }
    
    
    is the above "tablespace clause" comment wrong?
    since there is no "tablespace clause" related to CREATE STATISTICS.
    
    I guess that time, comments were just simply copied from
    function pg_get_indexdef_string.
    
    
    
    
  2. Re: mislead comments in pg_get_statisticsobjdef_string

    David Rowley <dgrowleyml@gmail.com> — 2025-09-25T23:05:17Z

    On Fri, 26 Sept 2025 at 01:17, jian he <jian.universality@gmail.com> wrote:
    >  * Internal version for use by ALTER TABLE.
    >  * Includes a tablespace clause in the result.
    >  * Returns a palloc'd C string; no pretty-printing.
    >  */
    > char *
    > pg_get_statisticsobjdef_string(Oid statextid)
    > {
    >     return pg_get_statisticsobj_worker(statextid, false, false);
    > }
    >
    > is the above "tablespace clause" comment wrong?
    
    Yes
    
    > since there is no "tablespace clause" related to CREATE STATISTICS.
    >
    > I guess that time, comments were just simply copied from
    > function pg_get_indexdef_string.
    
    I expect you're correct.  I've pushed a fix. Thanks
    
    David