From:
Neil Conway <neilc(at)samurai(dot)com>
To:
NikhilS <nikkhils(at)gmail(dot)com>
Cc:
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-06-02 20:59:38
Message-ID:
1180817978.5297.17.camel@goldbach (view raw or flat )
Thread:
2007-03-06 11:57:50 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-06 12:40:02 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2007-03-06 13:01:41 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-06 13:57:56 from Gregory Stark <stark(at)enterprisedb(dot)com>
2007-03-06 14:11:41 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-06 14:13:58 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-07 03:06:29 from Trevor Hardcastle <chizu(at)spicious(dot)com>
2007-04-02 23:06:11 from Bruce Momjian <bruce(at)momjian(dot)us>
2007-04-05 03:08:15 from Bruce Momjian <bruce(at)momjian(dot)us>
2007-04-05 03:25:52 from Gregory Stark <stark(at)enterprisedb(dot)com>
2007-04-05 14:23:03 from Bruce Momjian <bruce(at)momjian(dot)us>
2007-04-10 01:22:24 from Bruce Momjian <bruce(at)momjian(dot)us>
2007-04-10 08:20:16 from NikhilS <nikkhils(at)gmail(dot)com>
2007-04-11 21:10:01 from Bruce Momjian <bruce(at)momjian(dot)us>
2007-04-12 17:56:09 from Trevor Hardcastle <chizu(at)spicious(dot)com>
2007-04-13 05:51:56 from NikhilS <nikkhils(at)gmail(dot)com>
2007-04-13 16:42:51 from Trevor Hardcastle <chizu(at)spicious(dot)com>
2007-04-27 01:12:08 from Bruce Momjian <bruce(at)momjian(dot)us>
2007-04-27 22:59:10 from Neil Conway <neilc(at)samurai(dot)com>
2007-05-02 11:39:16 from NikhilS <nikkhils(at)gmail(dot)com>
2007-05-03 05:24:45 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-03 05:59:52 from NikhilS <nikkhils(at)gmail(dot)com>
2007-05-03 06:32:20 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-03 05:49:39 from Neil Conway <neilc(at)samurai(dot)com>
2007-05-17 13:09:15 from NikhilS <nikkhils(at)gmail(dot)com>
2007-05-17 14:31:59 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-17 18:38:39 from Gregory Stark <stark(at)enterprisedb(dot)com>
2007-05-17 20:04:32 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-17 20:40:07 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-18 07:26:06 from NikhilS <nikkhils(at)gmail(dot)com>
2007-05-18 14:45:01 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-20 06:34:37 from NikhilS <nikkhils(at)gmail(dot)com>
2007-05-15 02:58:35 from Neil Conway <neilc(at)samurai(dot)com>
2007-05-18 00:36:28 from Neil Conway <neilc(at)samurai(dot)com>
2007-05-18 00:43:25 from Bruce Momjian <bruce(at)momjian(dot)us>
2007-05-21 06:53:42 from NikhilS <nikkhils(at)gmail(dot)com>
2007-05-22 15:36:34 from Bruce Momjian <bruce(at)momjian(dot)us>
2007-05-22 15:48:38 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2007-05-23 06:15:41 from NikhilS <nikkhils(at)gmail(dot)com>
2007-05-23 06:53:21 from NikhilS <nikkhils(at)gmail(dot)com>
2007-05-23 10:54:29 from NikhilS <nikkhils(at)gmail(dot)com>
2007-05-23 13:40:39 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2007-05-23 13:59:12 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-23 14:08:33 from NikhilS <nikkhils(at)gmail(dot)com>
2007-05-23 14:24:42 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2007-05-23 14:38:53 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-05-23 14:39:20 from NikhilS <nikkhils(at)gmail(dot)com>
2007-05-29 00:35:34 from Bruce Momjian <bruce(at)momjian(dot)us>
2007-05-29 02:30:38 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-06-02 20:59:38 from Neil Conway <neilc(at)samurai(dot)com>
2007-06-02 21:43:34 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-06-03 14:02:58 from NikhilS <nikkhils(at)gmail(dot)com>
2007-06-03 14:48:21 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-06-05 09:20:23 from NikhilS <nikkhils(at)gmail(dot)com>
2007-07-10 05:57:22 from Neil Conway <neilc(at)samurai(dot)com>
2007-07-10 07:23:13 from NikhilS <nikkhils(at)gmail(dot)com>
2007-07-16 07:46:39 from Neil Conway <neilc(at)samurai(dot)com>
2007-07-16 08:58:32 from NikhilS <nikkhils(at)gmail(dot)com>
2007-07-16 10:08:52 from Neil Conway <neilc(at)samurai(dot)com>
2007-07-16 10:20:09 from NikhilS <nikkhils(at)gmail(dot)com>
2007-07-17 05:03:40 from Neil Conway <neilc(at)samurai(dot)com>
2007-07-20 03:03:02 from Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
2007-07-20 11:40:46 from Gregory Stark <stark(at)enterprisedb(dot)com>
2007-07-20 21:01:29 from "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
2007-07-21 09:54:17 from Gregory Stark <stark(at)enterprisedb(dot)com>
2007-07-10 21:38:53 from Bruce Momjian <bruce(at)momjian(dot)us>
2007-07-11 05:15:28 from "Jaime Casanova" <systemguards(at)gmail(dot)com>
2007-06-03 13:57:15 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-06 16:13:39 from Shane Ambler <pgsql(at)Sheeky(dot)Biz>
2007-03-06 17:43:19 from Martijn van Oosterhout <kleptog(at)svana(dot)org>
2007-03-06 18:27:03 from "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
2007-03-06 18:44:31 from Josh Berkus <josh(at)agliodbs(dot)com>
2007-03-06 21:54:50 from "Joris Dobbelsteen" <Joris(at)familiedobbelsteen(dot)nl>
2007-03-07 06:40:39 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-08 04:07:42 from Jim Nasby <decibel(at)decibel(dot)org>
2007-03-08 08:22:27 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-08 18:44:20 from "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
2007-03-08 22:01:10 from Shane Ambler <pgsql(at)Sheeky(dot)Biz>
2007-03-09 06:23:04 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-10 04:44:28 from Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
2007-03-10 05:13:12 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-12 15:13:51 from Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
2007-03-09 09:31:27 from "Zeugswetter Andreas ADI SD" <ZeugswetterA(at)spardat(dot)at>
2007-03-09 21:41:10 from Jim Nasby <jim(at)nasby(dot)net>
2007-03-09 22:16:20 from Hannu Krosing <hannu(at)skype(dot)net>
2007-03-10 04:58:55 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-06 18:35:19 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2007-03-06 18:44:25 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2007-03-06 19:04:41 from Josh Berkus <josh(at)agliodbs(dot)com>
2007-03-06 20:34:53 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2007-03-07 07:20:19 from Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>
2007-03-07 07:49:53 from "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
2007-03-07 06:44:49 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-07 09:01:21 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2007-03-07 10:26:40 from "Simon Riggs" <simon(at)2ndquadrant(dot)com>
2007-03-07 11:52:57 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-07 15:23:40 from "Luke Lonergan" <llonergan(at)greenplum(dot)com>
2007-03-07 15:52:22 from "Simon Riggs" <simon(at)2ndquadrant(dot)com>
2007-03-07 16:45:51 from "Zeugswetter Andreas ADI SD" <ZeugswetterA(at)spardat(dot)at>
2007-03-08 03:32:14 from "Luke Lonergan" <llonergan(at)greenplum(dot)com>
2007-03-08 08:45:43 from "Simon Riggs" <simon(at)2ndquadrant(dot)com>
2007-03-08 20:10:29 from Shane Ambler <pgsql(at)Sheeky(dot)Biz>
2007-03-09 06:18:34 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-09 11:17:38 from "Simon Riggs" <simon(at)2ndquadrant(dot)com>
2007-03-09 11:55:01 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-08 04:27:03 from Jim Nasby <decibel(at)decibel(dot)org>
2007-03-08 08:47:32 from "Simon Riggs" <simon(at)2ndquadrant(dot)com>
2007-03-08 10:12:30 from Gregory Stark <stark(at)enterprisedb(dot)com>
2007-03-08 18:51:19 from "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
2007-03-08 10:22:08 from "Zeugswetter Andreas ADI SD" <ZeugswetterA(at)spardat(dot)at>
2007-03-06 17:01:02 from Chris Browne <cbbrowne(at)acm(dot)org>
2007-03-07 13:34:16 from "Zeugswetter Andreas ADI SD" <ZeugswetterA(at)spardat(dot)at>
2007-03-07 14:29:48 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-07 14:58:32 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2007-03-07 20:13:40 from "Joris Dobbelsteen" <Joris(at)familiedobbelsteen(dot)nl>
2007-03-08 08:09:54 from NikhilS <nikkhils(at)gmail(dot)com>
2007-03-08 04:17:38 from Jim Nasby <decibel(at)decibel(dot)org>
2007-03-08 18:54:57 from "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
Lists:
pgsql-hackers pgsql-patches
On Mon, 2007-21-05 at 12:23 +0530, NikhilS wrote:
> I had spent some time on this earlier so decided to complete and send
> the patch to you for review. This patch supports copying of
> expressions, predicates, opclass, amorder, reloptions etc. The test
> case also contains some more additions with this patch. Please let me
> know if there are any issues.
Attached is a revised version of this patch. Note that this pattern is
always unsafe:
ht_am = SearchSysCache(AMOID, ...);
if (!HeapTupleIsValid(ht_am))
elog(ERROR, "...");
amrec = (Form_pg_am) GETSTRUCT(ht_am);
index->accessMethod = NameStr(amrec->amname);
/* ... */
ReleaseSysCache(ht_am);
return index;
Before calling ReleaseSysCache(), all the data you need from the
syscache entry needs to be deep-copied to allow subsequent access, but
NameStr() doesn't do a deep-copy. Adding "-DFORCE_CATCACHE_RELEASE" is a
useful way to catch these kinds of problems (I wonder if this is worth
adding to the default CFLAGS when assertions are enabled?)
I also made a bunch of editorial changes, including moving the
varattnos_map_schema() call out of the loop in transformInhRelation().
BTW, comments like "This function is based on code from ruleutils.c"
would be helpful for reviewers (whether in the patch itself or just in
the email containing the patch).
There's still a few things I need to fix in the patch, but I'll apply a
revised version of the attached patch to HEAD tomorrow, barring any
objections.
-Neil
In response to
Responses
pgsql-hackers by date
Next :From: Tom LaneDate: 2007-06-02 21:43:34
Subject : Re: CREATE TABLE LIKE INCLUDING INDEXES support
Previous :From : Peter EisentrautDate : 2007-06-02 20:19:15
Subject : Autovacuum launcher doesn't notice death of postmaster immediately
pgsql-patches by date
Next :From: Tom LaneDate: 2007-06-02 21:43:34
Subject : Re: CREATE TABLE LIKE INCLUDING INDEXES support
Previous :From : Peter EisentrautDate : 2007-06-02 20:19:15
Subject : Autovacuum launcher doesn't notice death of postmaster immediately