Re: CREATE TABLE LIKE INCLUDING INDEXES support

From: NikhilS <nikkhils(at)gmail(dot)com>
To: "Neil Conway" <neilc(at)samurai(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "Trevor Hardcastle" <chizu(at)spicious(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: CREATE TABLE LIKE INCLUDING INDEXES support
Date: 2007-07-10 07:23:13
Message-ID: d3c4af540707100023te49748bi323b1d7ee5674e38@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hi,

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

Yes, I too would vote for duplicating the lookups for the sake of
simplicity.

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

Yes, in the CREATE..LIKE case, options will be NULL and in the normal
CREATE..INDEX case inhreloptions will be NULL. Note that options is a List
of DefElem entries, whereas inhreloptions is a char pointer.

The challenge was with converting the stored reloptions belonging to the
parent index into some form which could be consumed by
transformRelOptions(). It was difficult to convert it into a list of DefElem
entries and hence I had to introduce inhreloptions.

Regards,
Nikhils
--
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shelby Epps 2007-07-10 09:17:25 Man Lebt nur einmal - probiers aus ! of clarity I think -- who've faced the
Previous Message Neil Conway 2007-07-10 05:57:22 Re: CREATE TABLE LIKE INCLUDING INDEXES support

Browse pgsql-patches by date

  From Date Subject
Next Message Heikki Linnakangas 2007-07-10 09:42:02 Re: Maintaining cluster order on insert
Previous Message Neil Conway 2007-07-10 05:57:22 Re: CREATE TABLE LIKE INCLUDING INDEXES support