Re:How can udf c function return table, not the rows?

From: Wen Yi <wen-yi(at)qq(dot)com>
To: David G(dot) Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re:How can udf c function return table, not the rows?
Date: 2024-07-19 23:26:46
Message-ID: tencent_9793550AD314C8D2383F373BE94B97E2BA07@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

You're right, thanks!

Wen&nbsp;Yi
wen-yi(at)qq(dot)com

---Original---
From: "David G. Johnston"<david(dot)g(dot)johnston(at)gmail(dot)com&gt;
Date: Fri, Jul 19, 2024 21:04 PM
To: "Wen Yi"<wen-yi(at)qq(dot)com&gt;;
Cc: "pgsql-hackers"<pgsql-hackers(at)lists(dot)postgresql(dot)org&gt;;
Subject: How can udf c function return table, not the rows?

On Thursday, July 18, 2024, Wen Yi <wen-yi(at)qq(dot)com&gt; wrote:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pg_get_functiondef&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
----------------------------------------------------------------------

In my expectations, it should be:

&nbsp;oid&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pg_get_functiondef&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
------+------------------------------------------------------------------------

Can someone give my some advice?

Write:

Select * from function_call()

Instead of

Select function_call()&nbsp;

Guessing a bit since you never did show the first query.

David J.

Browse pgsql-hackers by date

  From Date Subject
Next Message Joseph Koshakow 2024-07-19 23:32:18 Re: Remove dependence on integer wrapping
Previous Message Laurenz Albe 2024-07-19 22:07:36 Re: Incremental backup from a streaming replication standby fails