Re: Arguments to foreign tables? - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Arguments to foreign tables?
Date
Msg-id 1352266421.6292.73.camel@jdavis-laptop
Whole thread Raw
In response to Re: Arguments to foreign tables?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, 2012-11-06 at 12:57 -0500, Tom Lane wrote:
> That particular example can be handled perfectly well today, with
> 
>     select * from stream_table where tscol < 'whatever';
> 
> The FDW could be coded to throw an error if the query doesn't provide a
> WHERE clause that constrains the timestamp column suitably.  It does
> mean that you have to expose the "argument" as a result column, but at
> least for this use-case that hardly seems like a problem.

Oh, interesting idea to require a WHERE clause that way. I guess, in
theory, you could have an operator that always returns TRUE, and pass
everything down in WHERE clauses that way.

I think there is a case for actual arguments though: remote settings for
GUCs (as Simon pointed out); maybe the host to get the data from if it's
available from several locations; and if we support defining the schema
on the fly (like SRFs that return RECORD) then you could pass column
lists.

Regards,Jeff Davis




pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Proposal for Allow postgresql.conf values to be changed via SQL
Next
From: Amit Kapila
Date:
Subject: Re: WIP patch for hint bit i/o mitigation