On 1/15/14, 12:35 AM, Tom Lane wrote:
Jim Nasby <j...@nasby.net> writes:
Do we actually support = right now? We already support
v_field := field FROM table ... ;
and I think it's a bad idea to have different meaning for = and :=.

That ship sailed a *very* long time ago.  See other thread about
documenting rather than ignoring this more-or-less-aboriginal
behavior of plpgsql.

Yeah, I had no idea that was even supported...

I have no idea if this is related or not, but I would REALLY like for this to 
work (doesn't in 8.4, AFAIK not in 9.1 either...)

Hm ... too tired to be sure, but I think the issue about inlining a
function of this kind has to do with whether you get the same answers
in corner cases such as subselect fetching no rows.

There was some discussion about this a few years ago and I think that was 
essentially the issue.

What I think would work is essentially a macro that would dump the function 
definition right into the query and then let the planner deal with it. So

SELECT blah, ( SELECT status_code FROM status_code WHERE status_code_id = 
blah_status_code_id ) FROM blah;

can become simply

SELECT blah, status_code__get_text( blah_status_code_id ) FROM blah;

but have it translate to the same raw SQL, same as views.
--
Jim C. Nasby, Data Architect                       j...@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to