Re: create table like: ACCESS METHOD

Поиск
Список
Период
Сортировка
Искать
От
Michael Paquier
Тема
Re: create table like: ACCESS METHOD
Дата
Msg-id
YSh6YzKSg5qfqdrQ@paquier.xyz
Ответ на
Список
Дерево обсуждения
create table like: ACCESS METHOD Justin Pryzby <pryzby@telsasoft.com>
Re: create table like: ACCESS METHOD Michael Paquier <michael@paquier.xyz>
Re: create table like: ACCESS METHOD Justin Pryzby <pryzby@telsasoft.com>
Re: create table like: ACCESS METHOD Simon Riggs <simon@2ndquadrant.com>
Re: create table like: ACCESS METHOD Justin Pryzby <pryzby@telsasoft.com>
Re: create table like: ACCESS METHOD Justin Pryzby <pryzby@telsasoft.com>
Re: create table like: ACCESS METHOD Justin Pryzby <pryzby@telsasoft.com>
Re: create table like: ACCESS METHOD Michael Paquier <michael@paquier.xyz>
Re: create table like: ACCESS METHOD Michael Paquier <michael@paquier.xyz>
Re: create table like: ACCESS METHOD Vik Fearing <vik@postgresfriends.org>
Re: create table like: ACCESS METHOD Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: create table like: ACCESS METHOD Michael Paquier <michael@paquier.xyz>
Re: create table like: ACCESS METHOD Michael Paquier <michael@paquier.xyz>
Re: create table like: ACCESS METHOD David Steele <david@pgmasters.net>
On Tue, Jun 01, 2021 at 02:10:45PM -0500, Justin Pryzby wrote:
> rebased and alphabetized

+   /* ACCESS METHOD doesn't apply and isn't copied for partitioned tables */
+   if ((table_like_clause->options & CREATE_TABLE_LIKE_ACCESS_METHOD) != 0 &&
+       !cxt->ispartitioned)
+       cxt->accessMethod = get_am_name(relation->rd_rel->relam);
I was thinking about an ERROR here, but all the other options do the
work when specified only if required, so that's fine.  We should have
a test with a partitioned table and the clause specified, though.

+         
+          The table's access method will be copied.  By default, the
+          default_table_access_method is used.
+         
Why is there any need to mention default_table_access_method?  This
just inherits the AM from the source table, which has nothing to do
with the default directly.

+CREATE ACCESS METHOD heapdup TYPE TABLE HANDLER heap_tableam_handler;
+CREATE TABLE likeam() USING heapdup;
+CREATE TABLE likeamlike(LIKE likeam INCLUDING ALL);
Rather than creating a custom AM in this test path, I would be
tempted to move that to create_am.sql.
--
Michael
В списке pgsql-hackers по дате отправления
От: Amit Kapila
Дата:
От: Julien Rouhaud
Дата:
FAQ