Re: Like to RETURN SQL results set

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

 



Hi Erik,
I see this posting first time. I did not receive this email or link in the past.
I have read the entire link. I appreciate looking into this issue.
At this time, I do not have option of going to the document database or NoSQL.

I have developed the function to cater our needs. In our case, view might not work out.

I am getting a SQL which is generated dynamically. I will be happy to share in case anyone is interested.
Now I need to execute the SQL dynamically which is generated dynamically. I am facing challenges in the executing the SQL.
I could not follow JSON part. Do you have any case where I can see JSON is used to solve this type of problem.

This may have solutions from many tools but we are staying with pgsql because currently it is installed on aws/rds /postgres. W do not need to worry about any licenses.

Thanks,
Sarwar
 

From: Erik Wienhold <ewie@xxxxxxxxx>
Sent: Thursday, March 28, 2024 6:46 PM
To: M Sarwar <sarwarmd02@xxxxxxxxxxx>
Cc: Laurenz Albe <laurenz.albe@xxxxxxxxxxx>; pgsql-admin@xxxxxxxxxxxxxxxxxxxx <pgsql-admin@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: Like to RETURN SQL results set
 
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://na01.safelinks.protection.outlook.com/?url="">

--
Erik

[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux