Re: Proposed patch for bug #3921 - Mailing list pgsql-patches

From Gregory Stark
Subject Re: Proposed patch for bug #3921
Date
Msg-id 87ve5688gm.fsf@oxford.xeocode.com
Whole thread Raw
In response to Proposed patch for bug #3921  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Proposed patch for bug #3921  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> An issue that this patch doesn't address is what happens if the source
> index is in a non-default tablespace that the current user does not have
> CREATE permission for.  With both current CVS HEAD and this patch, that
> will result in an error.  Is that okay?

I was going to say "we could add a hint suggesting how to specify the
tablespace" but as you pointed out earlier there really isn't a way to specify
the tablespace.

Hm, looking at the grammar we already have something like this for
constraints. We could add an OptConsTableSpace after INCLUDING INDEXES. I just
tested it and it didn't cause any conflicts which makes sense since like
options appear in the column list.

So the syntax would be

CREATE TABLE foo (..., LIKE bar INCLUDING INDEXES USING INDEX TABLESPACE foo_ts, ...)

Kind of verbose but nice that it's the same syntax as constraints.

Not sure how easy it would be to shoehorn into t he like processing, I could
look at that if you want.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's RemoteDBA services!

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Proposed patch for bug #3921
Next
From: Tom Lane
Date:
Subject: Re: Proposed patch for bug #3921