Re: How can I use crosstab functons in PostgreSQL 9.3?

From: Rob Richardson <RDRichardson(at)rad-con(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How can I use crosstab functons in PostgreSQL 9.3?
Date: 2015-10-15 14:39:25
Message-ID: 67D108EDFAD3C148A593E6ED7DCB4BBD014F1A152B@RADCONWIN2K8PDC.radcon.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tim,

Thank you, but I think I already did that. The query is a dollar-quoted string, so there should be no need to do anything with the single quote marks within it, so I would have thought the query engine would already know that it's text. But after seeing the first error message, I explicitly casted it using "::text". The error message that time said that crosstab(text) was not found, so that doesn't seem to be the problem.

RobR

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of Tim Clarke
Sent: Thursday, October 15, 2015 10:31 AM
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] How can I use crosstab functons in PostgreSQL 9.3?

Looks to me like argument types possibly? The article creates various combinations of crosstab() function but you are passing in a query. Wrap your query in quotes (and then escape those within it). Then you'll be passing in a "text" type not an "unknown" as the error clearly shows.

Tim Clarke

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rob Richardson 2015-10-15 14:40:11 Re: How can I use crosstab functons in PostgreSQL 9.3?
Previous Message Tim Clarke 2015-10-15 14:30:51 Re: How can I use crosstab functons in PostgreSQL 9.3?