Re: CREATE TABLE LIKE INCLUDING INDEXES support - Mailing list pgsql-patches

From Neil Conway
Subject Re: CREATE TABLE LIKE INCLUDING INDEXES support
Date
Msg-id 1184047042.8180.10.camel@goldbach
Whole thread Raw
In response to Re: CREATE TABLE LIKE INCLUDING INDEXES support  (NikhilS <nikkhils@gmail.com>)
Responses Re: CREATE TABLE LIKE INCLUDING INDEXES support
Re: CREATE TABLE LIKE INCLUDING INDEXES support
List pgsql-patches
On Tue, 2007-05-06 at 14:50 +0530, NikhilS wrote:
> PFA, a patch which provides the "CREATE .. INCLUDING INDEXES"
> functionality. This patch uses the same functionality introduced by
> the earlier patches in this thread albeit for the "INCLUDING INDEXES"
> case.

Attached is a revised version of this patch. Sorry for taking so long to
make progress on this: my new job been keeping my busy, and I've
recently been ill.

This version updates the patch to CVS HEAD and has various fixes and
refactoring, including proper docs. I refactored get_opclass_name() into
lsyscache.c, but then realized that this means that lsyscache.c will
depend on commands/indexcmds.c (for GetDefaultOpClass()), which is
arguably improper, so I'm tempted to revert and just duplicate the
syscache lookups in both ruleutils.c and parse_utilcmd.c

Nikhil: why are both "options" and "inhreloptions" necessary in
IndexStmt? Won't at least one be NULL?

BTW, I notice that include/defrem.h contains declarations for several
different, marginally-related .c files (indexcmds.c, functioncmds.c,
operatorcmds.c, aggregatecmds.c, opclasscmds.c, define.c). I'm inclined
to separate these declarations into separate header files; any
objections to doing that?

-Neil


Attachment

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Maintaining cluster order on insert
Next
From: NikhilS
Date:
Subject: Re: CREATE TABLE LIKE INCLUDING INDEXES support