Re: Pet Peeves?

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Pet Peeves?
Date: 2009-01-30 17:41:38
Message-ID: d666697e-a1d5-4367-b57d-7b61637e7216@mm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Gregory Stark wrote:

>> MS-Access SQL has a TRANSFORM clause that allows for crosstab
>> queries without the need to know in advance the number of columns:
>> http://msdn.microsoft.com/en-us/library/bb208956.aspx
>
> That's puzzling. I wonder what they do about clients requesting info
> about the results. Or for that matter such queries being used in
> subqueries or anywhere else where the surrounding code needs to know
> the type of results to expect.

Using them in subqueries is just denied. Maybe there are also caveats
with the API.

>> As for Oracle, it wasn't possible until recently but now 11g has the
PIVOT
>> clause:
>>
http://www.oracle.com/technology/pub/articles/oracle-database-11g-top-f

>> eatures/11g-pivot.html
>
> From this the result columns do need to be explicitly listed in
advance unless
> you're asking for the pivot to be into an xml blob which seems like a
whole
> different feature really.

Ah yes, it's still not as helpful as it should ideally, just closer. I
guess that when implementing PIVOT they would have allowed fully
dynamic columns if that was at all possible, so it's probably not.
Sure, if names/types of columns can be queried before the execute stage
but in the case of PIVOT they had to be generated by the execute stage,
that would lead to an impossible chicken-and-egg situation. Maybe
that's the reason.

Best regards,
--
Daniel
PostgreSQL-powered mail user agent and storage:
http://www.manitou-mail.org

In response to

Browse pgsql-general by date

  From Date Subject
Next Message rhubbell 2009-01-30 18:09:42 Re: Pet Peeves?
Previous Message Sam Mason 2009-01-30 17:31:55 Re: Pet Peeves?