X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CBACE52834 for ; Mon, 6 Jun 2005 07:20:26 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 37810-06 for ; Mon, 6 Jun 2005 10:20:22 +0000 (GMT) Received: from mx-00.sil.at (mx-00.sil.at [62.116.68.196]) by svr1.postgresql.org (Postfix) with ESMTP id BAFF652841 for ; Mon, 6 Jun 2005 07:20:21 -0300 (ADT) Received: (qmail-ldap/ctrl 79964 invoked from network); 6 Jun 2005 10:20:22 -0000 Received: from unknown (HELO io.sonorys.at) ([213.235.243.42]) (envelope-sender ) by mx-00.sil.at (qmail-ldap-1.03) with SMTP for ; 6 Jun 2005 10:20:22 -0000 Received: from neptun.sonorys.at (neptun.sonorys.at [172.24.1.17]) by io.sonorys.at (8.11.7+Sun/8.11.7) with ESMTP id j56AKNG11367; Mon, 6 Jun 2005 12:20:23 +0200 (MEST) Received: by neptun.sonorys.at with Internet Mail Service (5.5.2653.19) id ; Mon, 6 Jun 2005 12:20:23 +0200 Message-ID: From: =?ISO-8859-1?Q?K=D6PFERL_Robert?= To: "'Marc Wrubleski'" , pgsql-sql@postgresql.org Subject: Re: Returning a Cross Tab record set from a function Date: Mon, 6 Jun 2005 12:20:22 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="ISO-8859-1" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200506/75 X-Sequence-Number: 21676 |-----Original Message----- |From: Marc Wrubleski [mailto:mlwruble@math.ucalgary.ca] |Sent: Mittwoch, 01. Juni 2005 16:15 |To: pgsql-sql@postgresql.org |Subject: [SQL] Returning a Cross Tab record set from a function | [...] | |It seems I can do this from any higher level language, but it drives me |crazy that I can't perform this operation as a function inside of |Postgres... Yes, semms very like this can't be done in just sql but needs a higher level lng. Actually Postgres provides such higher languages. Try including PL/Python PL/perl or PL/tk. Fom there you are able to query all the metadata of the wanted tables so that a adequate SQL-string can be generated. In case of sourcecode, you find theses languages in the contrib dir | |Thanks for any thoughts you might have... | |-- |Marc Wrubleski | | |---------------------------(end of |broadcast)--------------------------- |TIP 9: the planner will ignore your desire to choose an index |scan if your | joining column's datatypes do not match |