Search Postgresql Archives

Re: Using a composite SQL type in C

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

 



Check the documentation about using composite-type arguments in C http://www.postgresql.org/docs/8.2/static/xfunc-c.html#AEN37402

You can use GetAttributeByNum() or GetAttributeByName() to get each value from your custom type. You will need to get the HeapTupleHeader first by calling PG_GETARG_HEAPTUPLEHEADER(). A quick google search brought up this tutorial that might help http://linuxgazette.net/142/peterson.html

Cheers


My problem is, how do I access this type in my function (in C), and how do I create a new object of this type to return from the function?  I need to store both a text and an int, to avoid doing an extra query around the result of this aggregate (to get the corresponding text value), which is what I'm currently doing.  Any ideas?


 


[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