Question about GetAttributeByNum(Name) ExecQual.c

Started by Zdenek Kotalaabout 17 years ago4 messages
#1Zdenek Kotala
Zdenek.Kotala@Sun.COM

GetAttributeByNum has first parameter as HeapTupleHeader, but most functions
use Datum and after that they call DatumGetHeapTupleHeader. The difference is
that DatumGetHeapTupleHeader performs detoast on tuple(row type).

Is it intention do not detoast in these functions or it is a bug?

thanks Zdenek

--
Zdenek Kotala Sun Microsystems
Prague, Czech Republic http://sun.com/postgresql

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Zdenek Kotala (#1)
Re: Question about GetAttributeByNum(Name) ExecQual.c

Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes:

GetAttributeByNum has first parameter as HeapTupleHeader, but most functions
use Datum and after that they call DatumGetHeapTupleHeader. The difference is
that DatumGetHeapTupleHeader performs detoast on tuple(row type).

Is it intention do not detoast in these functions or it is a bug?

You would certainly not want a tuple to get separately detoasted for
each attribute you pull from it. So having detoasting here would be
the wrong thing IMHO.

regards, tom lane

#3Zdenek Kotala
Zdenek.Kotala@Sun.COM
In reply to: Tom Lane (#2)
Re: Question about GetAttributeByNum(Name) ExecQual.c

Tom Lane napsal(a):

Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes:

GetAttributeByNum has first parameter as HeapTupleHeader, but most functions
use Datum and after that they call DatumGetHeapTupleHeader. The difference is
that DatumGetHeapTupleHeader performs detoast on tuple(row type).

Is it intention do not detoast in these functions or it is a bug?

You would certainly not want a tuple to get separately detoasted for
each attribute you pull from it. So having detoasting here would be
the wrong thing IMHO.

Does it mean that these function are every time called with heap tuple or
untoasted row type (composite data type)? What is purpose of these function.
They are not use in executor and never in the core (only in example and
regress). Should be really in executor?

Thanks Zdenek

--
Zdenek Kotala Sun Microsystems
Prague, Czech Republic http://sun.com/postgresql

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Zdenek Kotala (#3)
Re: Question about GetAttributeByNum(Name) ExecQual.c

Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes:

Does it mean that these function are every time called with heap tuple or
untoasted row type (composite data type)? What is purpose of these function.

Legacy support for third-party modules. They're really pretty much
deprecated but I don't foresee removing them.

regards, tom lane