Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1499E1337B43 for ; Sun, 27 Mar 2011 09:52:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 99699-05 for ; Sun, 27 Mar 2011 12:51:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f174.google.com (mail-iw0-f174.google.com [209.85.214.174]) by mail.postgresql.org (Postfix) with ESMTP id 63A31133798E for ; Sun, 27 Mar 2011 09:51:40 -0300 (ADT) Received: by iwn34 with SMTP id 34so2688446iwn.19 for ; Sun, 27 Mar 2011 05:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to:x-mailer; bh=8AD9GJBdy/vNTVMKCEZwgYux7XmI9jcilpw6rj+Asx4=; b=LM1UtBxTebwrRpvDEYK4fmh4dNYTkFQTm0jwOfTLg56j3yfUVByFHqtXSOSrL/qRHd xne8B9eev3uUxb5kMdAhe0jVRtp1bVn5sLzyt2dxVmi3DrcR1omZVAuorHtBtyd9cjIJ oepGDo5L7KeZf69CHXP024tQASgyUzYawDy44= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :message-id:references:to:x-mailer; b=nYiqxXyKlvKZFzsWQdaR05f0NEYRlZ7/QJw72CMAxeIF5D2ETKyOWy0gR4a+PemSZu bLPJB+2doPaNP1vuHpgfxmuu6CP9ZhQDFppSjhl+r61f9ryDLLDxFg1OHOdw6eHTiH6O WUoPljorKmiC59dNHaZubWo2OpDk1e6j3LV6Y= Received: by 10.42.221.196 with SMTP id id4mr4340086icb.141.1301230298926; Sun, 27 Mar 2011 05:51:38 -0700 (PDT) Received: from [172.21.24.1] (nusnet-228-5.dynip.nus.edu.sg [137.132.228.5]) by mx.google.com with ESMTPS id gy41sm2171660ibb.39.2011.03.27.05.51.29 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Mar 2011 05:51:36 -0700 (PDT) Subject: Re: foreign data wrappers Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: multipart/alternative; boundary=Apple-Mail-2669-800534858 From: Zheng Yang In-Reply-To: <4D8E0125.9060905@dunslane.net> Date: Sun, 27 Mar 2011 20:51:21 +0800 Cc: Shiv , Selena Deckelmann , Alvaro Herrera , Guillaume Lelarge , pgsql-students Message-Id: References: <690867AB-C50B-4354-91D0-8A0811639C4C@gmail.com> <4D879CD0.5030803@dunslane.net> <3EF9E4CC-CF42-4B45-86FF-4CB9D46D7442@gmail.com> <4D8AF8C2.3000007@lelarge.info> <4ACC318A-1B6F-49A5-9B02-49EEAF7B97C7@gmail.com> <1300985156-sup-3058@alvh.no-ip.org> <47676.208.91.122.102.1300985713.squirrel@dunslane.net> <603812A0-F464-44AE-8A90-DF9BD1DC2DB9@gmail.com> <4D8E0125.9060905@dunslane.net> To: Andrew Dunstan X-Mailer: Apple Mail (2.1082) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.898 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201103/34 X-Sequence-Number: 175 --Apple-Mail-2669-800534858 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi, I managed to clone a copy of 9.1devel and compiled an binary from it. I = also did a make in the 'contrib/file_fdw/' folder and a file_fdw.so file = is generated. But the following error occurs when I was trying to experiment with the = file FDW: postgres=3D# CREATE FUNCTION file_fdw_handler() RETURNS fdw_handler AS = 'file_fdw' LANGUAGE C STRICT; ERROR: could not access file "file_fdw": No such file or directory STATEMENT: CREATE FUNCTION file_fdw_handler() RETURNS fdw_handler AS = 'file_fdw' LANGUAGE C STRICT; ERROR: could not access file "file_fdw": No such file or directory Did I miss anything? ZY On 26-Mar-2011, at 11:07 PM, Andrew Dunstan wrote: >=20 >=20 > On 03/24/2011 10:07 PM, Zheng Yang wrote: >>=20 >>=20 >> I've briefly gone through the slides. Regarding the 6 callbacks, is = that correct to say that a full table scan will always be performed = irregardless of the sql statement, >> the FDW is blind to the sql query performed, right? >=20 > Yes, fairly much. If the feed is large you need some way to pass a = limit to the foreign side, possibly via table options. I'm fairly sure = you won't be able to get it via the SELECT statement. >=20 >>=20 >> And can anyone help explain what a planner is? What does this = "provide cost estimates to planner" mean? Thanks! >=20 >=20 > See = >=20 > If you're going to work on PostgreSQL code you need to read the docs. >=20 > cheers >=20 > andrew >=20 --Apple-Mail-2669-800534858 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii ERROR:  could not access file "file_fdw": No such = file or directory
STATEMENT:  CREATE FUNCTION = file_fdw_handler() RETURNS = fdw_handler AS 'file_fdw' LANGUAGE C = STRICT;
ERROR:  could not access file "file_fdw": No such = file or = directory


Did = I miss = anything?


ZY

<= div>

On 26-Mar-2011, at 11:07 PM, Andrew = Dunstan wrote:



On 03/24/2011 10:07 PM, Zheng Yang = wrote:


I've briefly = gone through the slides. Regarding the 6 callbacks, is that correct to = say that a full table scan will always be performed irregardless of the = sql statement,
the FDW is = blind to the sql query performed, right?

Yes, fairly = much. If the feed is large you need some way to pass a limit to the = foreign side, possibly via table options. I'm fairly sure you won't be = able to get it via the SELECT statement.


And can anyone = help explain what a planner is? What does this "provide cost estimates = to planner" mean? Thanks!


See <http://www.postgresql.org/docs/current/static/planner-optimizer.html>

If you're going to work on PostgreSQL code you need to = read the = docs.

cheers

andrew


= --Apple-Mail-2669-800534858--