Re: Need query

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

 



Caetano Traina Junior schrieb am 18.07.2021 um 15:19:>
Em sáb., 17 de jul. de 2021 às 05:33, Thomas Kellerer <shammat@xxxxxxx <mailto:shammat@xxxxxxx>> escreveu:
    And before you ask: it's not really possible to make this dynamic, so that the number
    of columns "automagically" increases when you have more fruits. One fundamental
    restriction of the SQL language is that the number and types of all columns
    must be known to the database when the query is parsed. It can't change
    the columns as a result of the query itself.

Nonetheless, it is always possible to write a dynamic SQL (and best
yet, inside a plpgsql function) to "automagically handle more
fruits..."

Even if you create a function that uses dynamic SQL, you still have to
specify each output column "manually" when calling the function.
So that doesn't really buy you anything.









[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