> @@ -5963,8 +5967,20 @@ describePublications(const char *pattern)
>               {
>                       /* Get the tables for the specified publication */
>                       printfPQExpBuffer(&buf,
> -                                                       "SELECT n.nspname, 
> c.relname\n"
> -                                                       "FROM 
> pg_catalog.pg_class c,\n"
> +                                                       "SELECT n.nspname, 
> c.relname, \n");
> +                     if (pset.sversion >= 150000)
> +                             appendPQExpBufferStr(&buf,
> +                                                                      "      
>  CASE WHEN pr.prattrs IS NOT NULL THEN\n"
> +                                                                      "      
>  pg_catalog.array_to_string"
> +                                                                      
> "(ARRAY(SELECT attname\n"
> +                                                                      "      
>    FROM pg_catalog.generate_series(0, 
> pg_catalog.array_upper(pr.prattrs::int[], 1)) s,\n"
> +                                                                      "      
>         pg_catalog.pg_attribute\n"
> +                                                                      "      
>   WHERE attrelid = c.oid AND attnum = prattrs[s]), ', ')\n"
> +                                                                      "      
>  ELSE NULL END AS columns");
> +                     else
> +                             appendPQExpBufferStr(&buf, "NULL as columns");
> +                     appendPQExpBuffer(&buf,
> +                                                       "\nFROM 
> pg_catalog.pg_class c,\n"
>                                                         "     
> pg_catalog.pg_namespace n,\n"
>                                                         "     
> pg_catalog.pg_publication_rel pr\n"
>                                                         "WHERE c.relnamespace 
> = n.oid\n"

I suppose this should use pr.prattrs::pg_catalog.int2[] ?

Did the DatumGetBool issue expose a deficiency in testing ?
I think the !am_partition path was never being hit.

-- 
Justin


Reply via email to