By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,179 Members | 970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,179 IT Pros & Developers. It's quick & easy.

How to get the requested columns in a rowtype PL/pgSQL function

P: n/a
Hi all,

Imagine I have a PL/pgSQL function called myfunction that returns a
rowtype like this

CREATE TYPE mytype AS (a integer, b integer, c integer);

Imagine that I often need only 1 or 2 of this values, just say I need to
do query like these :

select a from myfunction()
select a,c from myfunction()
select b,c from myfunction()

and so on.

Now, since computing a,b and c could be expensive in term of time, is
there a way to understand (from withing the PL/pgSQL function) which
fields where requested in the query and then avoid computing those who
are not needed ?

Thanks in advance for every hints !


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 22 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.