简体   繁体   中英

How to create a C-language function returning two or more OUT parameters for postgresql?

I need to return two arrays of integers in a C-language function for postgresql. Afaik, the best way to return two arrays of integers in a postgresql function is to declare the function with OUT parameters. But how to return two output parameters in a C-language function for postgresql? Should I return a tuple of two strings containing brace representations of the arrays?

You have to return tuple of two arrays. In reality Postgresql's function returns only one parameter every time. It is relative complex task, but it is possible. You can find some examples - google keyword is PG_RETURN_HEAPTUPLEHEADER

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM