Re: create table like: ACCESS METHOD

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: create table like: ACCESS METHOD
Дата
Msg-id 8b530d40-1e85-e3b4-774f-b9cb4e2b7ca2@enterprisedb.com
обсуждение исходный текст
Ответ на Re: create table like: ACCESS METHOD  (Vik Fearing <vik@postgresfriends.org>)
Ответы Re: create table like: ACCESS METHOD  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On 27.08.21 12:37, Vik Fearing wrote:
> It seems like this should error to me:
> 
> CREATE ACCESS METHOD heapdup TYPE TABLE HANDLER heap_tableam_handler;
> CREATE TABLE likeam1() USING heap;
> CREATE TABLE likeam2() USING heapdup;
> CREATE TABLE likeamlike(
>      LIKE likeam1 INCLUDING ACCESS METHOD,
>      LIKE likeam2 INCLUDING ACCESS METHOD
> );
> 
> At the very least, the documentation should say that the last one wins.

Hmm.  The problem is that the LIKE clause is really a macro that expands 
to the column definitions of the other table.  So there is, so far, no 
such as thing as two LIKE clauses contradicting.  Whereas the access 
method is a table property.  So I don't think this syntax is the right 
approach for this feature.

You might think about something like

CREATE TABLE t2 (...) USING (LIKE t1);

At least in terms of how the syntax should be structured.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: drop tablespace failed when location contains .. on win32
Следующее
От: "kuroda.hayato@fujitsu.com"
Дата:
Сообщение: RE: Allow escape in application_name