Re: warning: pg_query(): Query failed

From: Aaron Steele <asteele(at)berkeley(dot)edu>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: warning: pg_query(): Query failed
Date: 2005-01-05 19:16:29
Message-ID: 4D855D90-5F4E-11D9-B24F-000A95C0C442@berkeley.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hi bruno,

would it be useful to see the IF PLSQL function, or would you recommend
a modification to the database.pgsql.inc file?

On Jan 5, 2005, at 10:52 AM, Bruno Wolff III wrote:

> On Wed, Jan 05, 2005 at 10:17:39 -0800,
> Aaron Steele <asteele(at)berkeley(dot)edu> wrote:
>> hi,
>>
>> warning: pg_query(): Query failed: ERROR: invalid input syntax for
>> type
>> boolean: "2"
>> CONTEXT: PL/pgSQL function "if" line 2 at if in
>> /Library/WebServer/Documents/dmap/includes/database.pgsql.inc on line
>> 104.
>>
>> any ideas?
>
> The actual problem is in the PLSQL function named IF that you didn't
> show
> us.
>
> Recent versions of postgres have tightened up casting to boolean.
> Perhaps in the past '2'::boolean might have worked, but in 7.4 this
> won't work. '1' or '0' are valid boolean representations.
>
> ---------------------------(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
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Aaron Steele 2005-01-05 19:37:56 Re: warning: pg_query(): Query failed
Previous Message Joost Kraaijeveld 2005-01-05 19:15:28 Index on a view??