Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id ED2C71337FEF for ; Wed, 15 Sep 2010 04:02:38 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 80586-01-2 for ; Wed, 15 Sep 2010 07:02:31 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og116.obsmtp.com (exprod7og116.obsmtp.com [64.18.2.219]) by mail.postgresql.org (Postfix) with SMTP id 33B781338059 for ; Wed, 15 Sep 2010 04:02:31 -0300 (ADT) Received: from source ([209.85.215.43]) by exprod7ob116.postini.com ([64.18.6.12]) with SMTP ID DSNKTJBvhpOWPeoVpaMSOyfNA8zPWov9Nbzb@postini.com; Wed, 15 Sep 2010 00:02:31 PDT Received: by ewy1 with SMTP id 1so4135903ewy.16 for ; Wed, 15 Sep 2010 00:02:29 -0700 (PDT) Received: by 10.213.105.148 with SMTP id t20mr3597124ebo.30.1284534149764; Wed, 15 Sep 2010 00:02:29 -0700 (PDT) Received: from [192.168.1.117] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id a48sm1584506eei.19.2010.09.15.00.02.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 15 Sep 2010 00:02:28 -0700 (PDT) Message-ID: <4C906F81.4010108@enterprisedb.com> Date: Wed, 15 Sep 2010 10:02:25 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux i686; fi-FI; rv:1.9.1.10) Gecko/20100619 Iceowl/1.0b1 Icedove/3.0.5 MIME-Version: 1.0 To: SAKAMOTO Masahiko CC: pgsql-hackers@postgresql.org Subject: Re: patch: SQL/MED(FDW) DDL References: <4C905DB0.6040302@oss.ntt.co.jp> In-Reply-To: <4C905DB0.6040302@oss.ntt.co.jp> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201009/786 X-Sequence-Number: 169650 On 15/09/10 08:46, SAKAMOTO Masahiko wrote: > This is a proposal patch for SQL/MED for 9.1. > > At the prev. CF, this patch had so many features to make it hard > to review all of them. So I devided it into smaller parts: > (1) foreign table DDL support (this proposal): > - support for foreign table DDL syntax (CREATE/ALTER FOREIGN TABLE) > - Definition of FDW routine interface and system catalogs for it. > (2) SELECT support for external PostgreSQL tables. > > > First of all, I'd like to discuss and make agreement on the basic design > and its implementation for FDW interface. > Comments and ideas would be very appriciated, especially > on how system catalog stores the information about > foreign tables, server, and user mappings. In my mind the key question is: what does the API for writing foreign data wrappers look like? I couldn't figure that out by looking at the patch. The API needs to be simple and version-independent, so that you can write simple wrappers like the flat file wrapper easily. At the same time, it needs to be very flexible, so that it allows safely pushing down all kinds constructs like functions, aggregates and joins. The planner needs to know which constructs the wrapper can handle and get cost estimates for the foreign scans. Those two goals are at odds. I've been thinking about that for some time. Here's one sketch I made a while ago: http://archives.postgresql.org/pgsql-hackers/2008-07/msg00395.php. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com