Re: Debugging PostgreSql queries

From: Matthew Walden <matthew(dot)walden(at)bcs(dot)org>
To: Vaduvoiu Tiberiu <vaduvoiutibi(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Debugging PostgreSql queries
Date: 2010-11-18 09:06:34
Message-ID: AANLkTi==if+++fR=gfsZeryHEwcZpjvEe4ELxsw3uy+N@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, Nov 18, 2010 at 7:25 AM, Vaduvoiu Tiberiu <vaduvoiutibi(at)yahoo(dot)com>wrote:

> Long story short, I have a huge query in the application that throws the
> errror:
> "CASE types bigint and character varying cannot be matched ". I ran this
> query in pgAdmin, in phpPgAdmin, I only get the error but have no clue where
> the error actually is thrown. In mysql most of the time you get a "on line
> X" message in the error that can help you determine where the problem is.
> However in my case, since I didn't create the query( so I don't know the
> tables, fields, etc) and the query is very big, is there a way to find out
> where exactly where is this query thrown or do I have to manually start
> searching?
>
> 10x a lot
>
>
If you can run the query in psql you could try the following -

\set FETCH_COUNT 1
\pset pager off
<your query here>

It should cycle through row by row and then error on the line causing you
problems.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Vaduvoiu Tiberiu 2010-11-18 13:07:59 MySql week() method equivalent
Previous Message Vaduvoiu Tiberiu 2010-11-18 07:25:28 Debugging PostgreSql queries