Re: SQL/MED - core functionality

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Shigeru HANADA <hanada(at)metrosystems(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: SQL/MED - core functionality
Date: 2010-12-28 03:16:42
Message-ID: AANLkTinwRggPuGjPrg3=9VuRhGJgwv5QfiYJ7q81pKXH@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Dec 25, 2010 at 11:52 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> I'm working on getting a first chunk of this committed.

OK, here's the patch. Changes from the submitted fdw_syntax patch:

- I removed a LOT of frammishes from CREATE FOREIGN TABLE. I think
that the idea of letting foreign tables inherit from regular tables or
visca versa is interesting, but I don't think the patch got it
entirely right, and there's no reason it can't be added as a
subsequent commit. Check constraints are disallowed now, too. In
fact, basically all you can do with CREATE FOREIGN TABLE is set column
names, types, and whether they're NOT NULL. But I think that's enough
to get started.

- I hacked things around so that we use more of the existing parser
logic for CREATE TABLE and ALTER TABLE and then disallow the
constructs we don't support (like constraints and default values)
later on. I think this is preferable to replicating large chunks of
the create/alter table grammar, especially because, if this patch is
any indication, the fraction of it we're replicating is going to grow
over time and perhaps approach 100%. I'm not entirely sure I've
covered all the bases here, so some review of this logic would be
appreciated.

- I removed all of the changes related to adding a HANDLER option to
foreign data wrappers. I think that stuff properly belongs in the
"fdw scan" patch. Instead, what I've done here is just prohibit
foreign data wrappers from being used in queries. I'm generally
pretty negative on syntax-only patches, but then foreign data wrappers
have been basically syntax-only for two releases, and I think there's
a good chance that if we get the syntax patch in soon we'll actually
be able to make it work before we run out of time. So I'm feeling
like it might be OK in this case, especially because even with all the
trimming down I've done here, this is still a very big patch.

- Lots of cleanup, of both code and documentation.

I'd appreciate some review of what's attached, even though it's not
totally final yet. Unless there are serious objections to this whole
line of attack (which I hope there aren't, because I've put a ton of
time into this already), I'm going to continue working on beating this
into shape and, barring violent objections, eventually commit
something based on the version attached here.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
fdw-syntax-20101227.patch.gz application/x-gzip 36.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2010-12-28 03:35:17 Re: 9.1alpha3 release notes help
Previous Message Andrew Chernow 2010-12-28 03:06:05 Re: Suggesting a libpq addition