Re: Like to RETURN SQL results set - Mailing list pgsql-admin

From Erik Wienhold
Subject Re: Like to RETURN SQL results set
Date
Msg-id hxq6kue5366iodbhhpzlfhb67ppd4s3twt43dwckelnmloul4c@j6u3hsbf4pah
Whole thread Raw
In response to Re: Like to RETURN SQL results set  (M Sarwar <sarwarmd02@outlook.com>)
Responses Re: Like to RETURN SQL results set
List pgsql-admin
On 2024-03-28 23:27 +0100, M Sarwar wrote:
> Numbers of returning columns will vary  dynamically.  Based on that
> SELECT * FROM func() AS (c1 integer, c2 text) is not applicable in my
> case.

Dynamic table structures are hard to do in SQL, one of the reasons why
document databases and the NoSQL movement exist.  So why use crosstab
when it doesn't fit your use case?  Can you achieve the same with a view
or function that returns jsonb like it has been suggested[1] to you
before?  Does the query even have to be implemented inside the database?

[1] https://www.postgresql.org/message-id/CAJJx%2BiUFyTAN9F-C7xBx0sunr08aPvF_EnkGiHm7SP2mhakpqQ%40mail.gmail.com

-- 
Erik



pgsql-admin by date:

Previous
From: M Sarwar
Date:
Subject: Re: Like to RETURN SQL results set
Next
From: James Pang
Date:
Subject: [MASSMAIL]cached plan must not change result type