Arguments to foreign tables?
Re: Arguments to foreign tables?
От:
Ronan Dunklau <rdunklau@gmail.com>
Дата:
Maybe you could set some options on the foreign table before selecting from it ?
Another way you could achieve the same result would be to give some column a special meaning (like it is done in the twitter_fdw for example).
If you don't mind, do you have a specific use-case for this ?
--
Ronan Dunklau
2012/11/6 Jeff Davis <pgsql@j-davis.com>
On Sun, 2012-11-04 at 15:13 -0500, Tom Lane wrote:Maybe I should rephrase this as a problem with SRFs: you don't get to
> Jeff Davis <pgsql@j-davis.com> writes:
> > Is there any fundamental or philosophical reason why a foreign table
> > can't accept arguments?
>
> That isn't a table; it's some sort of function. Now that we have
> LATERAL, there is no good reason to contort SQL's syntax and semantics
> in the direction you suggest.
define the init/exec/end executor functions, and you don't get access to
the optimizer information.
It seems like foreign tables are a better mechanism (except for the
simple cases where you don't care about the details), and the only thing
an SRF can do that a foreign table can't is accept arguments. So, I
thought maybe it would make more sense to combine the mechanisms
somehow.
Take something as simple as generate_series: right now, it materializes
the entire thing if it's in the FROM clause, but it wouldn't need to if
it could use the foreign table mechanism.
Regards,
Jeff Davis
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Re: Arguments to foreign tables?
От:
Willem Leenen <willem_leenen@hotmail.com>
Дата:
I don't understand the question. A table accepting arguments? What do you mean with that? Can you give an code example in an other RDBMS (like oracle)?
Perhaps nothing came up because there are more people not understanding what you want to accomplish?
regards,
Willem
> Subject: [HACKERS] Arguments to foreign tables?
> From: pgsql@j-davis.com
> To: pgsql-hackers@postgresql.org
> Date: Sun, 4 Nov 2012 11:59:20 -0800
>
> Is there any fundamental or philosophical reason why a foreign table
> can't accept arguments? Should that be a TODO?
>
> Right now, to accept arguments to a from-clause item, you have to use an
> SRF, which is much more limited than a foreign table. If foreign tables
> could accept arguments, then SRFs could just be a simplified special
> case of foreign tables.
>
> I looked for some previous discussions on this topic and nothing turned
> up.
>
> Regards,
> Jeff Davis
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
> From: pgsql@j-davis.com
> To: pgsql-hackers@postgresql.org
> Date: Sun, 4 Nov 2012 11:59:20 -0800
>
> Is there any fundamental or philosophical reason why a foreign table
> can't accept arguments? Should that be a TODO?
>
> Right now, to accept arguments to a from-clause item, you have to use an
> SRF, which is much more limited than a foreign table. If foreign tables
> could accept arguments, then SRFs could just be a simplified special
> case of foreign tables.
>
> I looked for some previous discussions on this topic and nothing turned
> up.
>
> Regards,
> Jeff Davis
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
Re: Arguments to foreign tables?
От:
Willem Leenen <willem_leenen@hotmail.com>
Дата:
>
> what does that even mean? how would 'data' accept 'arguments' ??!
>
>
That's Sherlock Holmes! "Don't argue with your data"
> what does that even mean? how would 'data' accept 'arguments' ??!
>
>
That's Sherlock Holmes! "Don't argue with your data"