Re: Need query

From: Thomas Kellerer <shammat(at)gmx(dot)net>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Need query
Date: 2021-07-18 14:54:08
Message-ID: efdb82b5-5981-10bc-c087-af73282b9bfc@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)gmx(dot)net <mailto:shammat(at)gmx(dot)net>> 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.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message satish v 2021-07-19 10:31:52 Handling Huge wal files
Previous Message Caetano Traina Junior 2021-07-18 13:19:48 Re: Need query