On Wed, Dec 09, 2020 at 02:13:29PM -0600, Justin Pryzby wrote:
> I thought this was a good idea, but didn't hear back when I raised it before.
>
> Failing to preserve access method is arguably a bug, reminiscent of CREATE
> STATISTICS and 5564c1181. But maybe it's not important to backpatch a fix in
> this case, since access methods are still evolving.
Interesting. Access methods for tables are released for more than one
year now, so my take about a backpatch is that this boat has already
sailed. This may give a reason to actually not introduce this
feature.
+ CREATE_TABLE_LIKE_ACCESSMETHOD = 1 << 0,
Nit: wouldn't this be better as ACCESS_METHOD?
-- fail, as partitioned tables don't allow NO INHERIT constraints
-CREATE TABLE noinh_con_copy1_parted (LIKE noinh_con_copy INCLUDING ALL)
+CREATE TABLE noinh_con_copy1_parted (LIKE noinh_con_copy INCLUDING ALL EXCLUDING ACCESS METHOD)
PARTITION BY LIST (a);
This diff means that you are introducing an incompatible change by
forcing any application using CREATE TABLE LIKE for a partitioned
table to exclude access methods. This is not acceptable, and it may
be better to just ignore this clause instead in this context.
This patch should have more tests. Something could be added in
create_am.sql where there is a fake heap2 as table AM.
+ <para>
+ The table's access method will be copied. By default, the
+ <literal>default_table_access_method</literal> is used.
+ </para>
Second sentence sounds a bit strange by combining "the" and a GUC
name. I would just write "Default is default_table_a_m".
--
Michael