Re: CREATE FOREGIN TABLE LACUNA

From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE FOREGIN TABLE LACUNA
Date: 2012-03-14 14:32:11
Message-ID: 20120314143210.GB9921@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 14, 2012 at 10:27:28AM -0400, Tom Lane wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > On Wed, Mar 14, 2012 at 8:28 AM, David Fetter <david(at)fetter(dot)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(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2012-03-14 14:37:16 Re: Syntax error and reserved keywords
Previous Message Tom Lane 2012-03-14 14:27:28 Re: CREATE FOREGIN TABLE LACUNA