Re: CREATE FOREGIN TABLE LACUNA - Mailing list pgsql-hackers

From David Fetter
Subject Re: CREATE FOREGIN TABLE LACUNA
Date
Msg-id 20120314143210.GB9921@fetter.org
Whole thread Raw
In response to Re: CREATE FOREGIN TABLE LACUNA  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: CREATE FOREGIN TABLE LACUNA
List pgsql-hackers
On Wed, Mar 14, 2012 at 10:27:28AM -0400, Tom Lane wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
> > On Wed, Mar 14, 2012 at 8:28 AM, David Fetter <david@fetter.org> wrote:
> >> Here's a WIP patch (lots of cut/paste, no docs, no tests), but it does
> >> work. �Still to do in addition: decide whether ALTER FOREIGN TABLE
> >> should also handle LIKE.
>
> > I think that instead of inventing new grammar productions and a new
> > node type for this, you should just reuse the existing productions for
> > LIKE clauses and then reject invalid options during parse analysis.
>
> +1; in this approach, adding more features will make it worse not better.

OK :)

> > I'd actually like to see us allow foreign tables to have constraints.
> > Obviously, we can't enforce constraints on remote data, but the point
> > would be allow the system administrator to supply the query planner
> > with enough knowledge to make constraint exclusion work.  The fact
> > that you can't make that work today is a major gap, IMV.
>
> Hm.  That opinion seems to me to connect to the recently-posted
> patch to make contrib/file_fdw enforce NOT NULL constraints.  Should
> we instead have the position that constraints declared for foreign
> tables are statements that we can take on faith, and it's the user's
> fault if they are wrong?

I think that's something FDWs need to be able to communicate to
PostgreSQL.  For example, something talking to another PostgreSQL
would (potentially, anyhow) have access to deep knowledge of the
remote side, but file_fdw would only have best efforts even for clever
things like statistics.

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: CREATE FOREGIN TABLE LACUNA
Next
From: Pavel Stehule
Date:
Subject: Re: Syntax error and reserved keywords