Re: create table like: ACCESS METHOD

2021-10-01 Thread Michael Paquier
On Thu, Sep 09, 2021 at 02:30:51PM +0200, Peter Eisentraut wrote: > 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 >

Re: create table like: ACCESS METHOD

2021-09-09 Thread Peter Eisentraut
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, LIK

Re: create table like: ACCESS METHOD

2021-08-29 Thread Michael Paquier
On Fri, Aug 27, 2021 at 02:38:43PM +0900, Michael Paquier wrote: > +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 >

Re: create table like: ACCESS METHOD

2021-08-29 Thread Michael Paquier
On Fri, Aug 27, 2021 at 12:37:59PM +0200, 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

Re: create table like: ACCESS METHOD

2021-08-27 Thread Vik Fearing
On 3/23/21 1:39 AM, Justin Pryzby wrote: > On Tue, Jan 19, 2021 at 03:03:31PM -0600, Justin Pryzby wrote: >> On Wed, Dec 30, 2020 at 12:33:56PM +, Simon Riggs wrote: >>> There are no tests for the new functionality, please could you add some? >> >> Did you look at the most recent patch? >> >> +

Re: create table like: ACCESS METHOD

2021-08-26 Thread Michael Paquier
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->accessMet

Re: create table like: ACCESS METHOD

2021-06-01 Thread Justin Pryzby
rebased and alphabetized >From c1420e17cc2036d4bf3a6c1f9366bf1cd03bd831 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Sun, 15 Nov 2020 16:54:53 -0600 Subject: [PATCH v5] create table (like .. including ACCESS METHOD) --- doc/src/sgml/ref/create_table.sgml| 22 ++-

Re: create table like: ACCESS METHOD

2021-03-22 Thread Justin Pryzby
On Tue, Jan 19, 2021 at 03:03:31PM -0600, Justin Pryzby wrote: > On Wed, Dec 30, 2020 at 12:33:56PM +, Simon Riggs wrote: > > There are no tests for the new functionality, please could you add some? > > Did you look at the most recent patch? > > +CREATE ACCESS METHOD heapdup TYPE TABLE HANDLE

Re: create table like: ACCESS METHOD

2021-03-19 Thread David Steele
On 1/19/21 4:03 PM, Justin Pryzby wrote: On Wed, Dec 30, 2020 at 12:33:56PM +, Simon Riggs wrote: There are no tests for the new functionality, please could you add some? Did you look at the most recent patch? +CREATE ACCESS METHOD heapdup TYPE TABLE HANDLER heap_tableam_handler; +CREATE

Re: create table like: ACCESS METHOD

2021-01-19 Thread Justin Pryzby
On Wed, Dec 30, 2020 at 12:33:56PM +, Simon Riggs wrote: > There are no tests for the new functionality, please could you add some? Did you look at the most recent patch? +CREATE ACCESS METHOD heapdup TYPE TABLE HANDLER heap_tableam_handler; +CREATE TABLE likeam() USING heapdup; +CREATE TABLE

Re: create table like: ACCESS METHOD

2020-12-30 Thread Simon Riggs
On Tue, 29 Dec 2020 at 23:08, Justin Pryzby wrote: > > On Fri, Dec 25, 2020 at 03:41:46PM +0900, Michael Paquier wrote: > > 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

Re: create table like: ACCESS METHOD

2020-12-29 Thread Justin Pryzby
>accessMethod = cxt.accessMethod; + result = lappend(cxt.blist, stmt); result = list_concat(result, cxt.alist); result = list_concat(result, save_alist); @@ -1118,6 +1123,11 @@ transformTableLikeClause(CreateStmtContext *cxt, TableLikeClause *table_like_cla cxt->likeclauses = lappend(cxt-&

Re: create table like: ACCESS METHOD

2020-12-24 Thread Michael Paquier
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

create table like: ACCESS METHOD

2020-12-09 Thread Justin Pryzby
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. https://www.po