Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 3A6DF632C5D for ; Fri, 30 Jan 2009 16:51:58 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 83486-01-10 for ; Fri, 30 Jan 2009 16:51:54 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.190]) by mail.postgresql.org (Postfix) with ESMTP id 7A868632C4C for ; Fri, 30 Jan 2009 16:51:54 -0400 (AST) Received: by rn-out-0910.google.com with SMTP id k43so481898rnd.0 for ; Fri, 30 Jan 2009 12:51:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=DiWoNgnmLM4UJiuxIgSRfXzPIcYkZVLxT6L7U9cJRVI=; b=q8Dc9pcM3brHTpSPLtqN7bccgQoqK8lVF3bR4/4wAcpoSN8hQAdZ7XbVj2sCdcL09/ AA73ri1ZxzQxE/RNq8X6P36chdprvoWuGpsknWkLeH67eDhwEMujilufsIBg4jsqA3Xk 3LuKx6nw4LsIWVTpGvWHnHdv398SlCqMZ3+Ho= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=pdHSB/8ZxudnBMtCnQHEgSmpneAfzocu5ZP2jvLMvK5jvPR/49uLSbCFf6OGiQVPMw NlZg1/We7h5IFAbNjmPDNj3in3Q6vBIxloTa5rrD9XKJcvKCEA6tGkk8sRD7SlZtsr2o vDxlFV004rc4bovfKeYYq89dbGPiy/3iJLIrg= MIME-Version: 1.0 Received: by 10.100.142.15 with SMTP id p15mr1436170and.33.1233348712932; Fri, 30 Jan 2009 12:51:52 -0800 (PST) Reply-To: jimrenwick@gmail.com Date: Fri, 30 Jan 2009 13:51:52 -0700 Message-ID: <3cd1ec380901301251p6d57e3a1k37126680c435b21@mail.gmail.com> Subject: Table/Data extension model available? From: Jim Renwick To: pgsql-interfaces@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200901/10 X-Sequence-Number: 6849 Hi, Not sure where to ask this question. I have been going over the docs in some detail, and I see where http://www.postgresql.org/docs/8.2/static/xfunc-sql.html#XFUNC-SQL-TABLE-FUNCTIONS discusses options for building server extensions that will allow a user to use custom functions in the FROM clause of a SQL statement. It looks like I could build a custom C function that returns a SETOF custom type to simulate retrieval of data from an external source. However, it looks like the syntax of the function would require '()' after the table name, effectively changing the SQL syntax. So, for example: select * from internal_table i, function_simulating_external_table() e where i.id = e.id; I am guessing that will grab data from PGDATA table internal_table, and the results of executing whatever backs function_simulating_external_table() - say a web service - produces. Is that correct? At the end of the day, I am wondering if there is a way to use the SQL engine in postgres as a frontend to running distributed queries across arbitrary backend data providers. Does anyone know if this is common and simple to do? Thanks, Jim Renwick