Search Postgresql Archives

Re: Feature proposal and discussion: full-fledged column/function equivalence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vik Fearing wrote
>> CREATE testfunction(test) returns int language sql as $$ select 1; $$;
>> SELECT testfunction FROM test;
>> 
>> That would allow first-class calculated columns.
>> 
>> I assume the work is mostly at the parser/grammatical level.  Is there
>> any reason why supporting that would be a bad idea?
> 
> This is already supported since forever.
> 
> SELECT test.testfunction FROM test;

More to the point: if you are writing a multiple-relation query and have
"testfunction" functions defined for at least two of the relations used in
the query how would the system decide which one to use?

SELECT testfunction FROM test JOIN test_extended USING (test_id)

I guess you could allow for the non-ambiguous cases and error out otherwise
but that seems to be adding quite a bit of complexity for little gain.

David J.



--
View this message in context: http://postgresql.1045698.n5.nabble.com/Feature-proposal-and-discussion-full-fledged-column-function-equivalence-tp5813533p5813571.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux