Re: warning: pg_query(): Query failed

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Aaron Steele <asteele(at)berkeley(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: warning: pg_query(): Query failed
Date: 2005-01-06 23:08:34
Message-ID: 20050106230834.GA24431@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jan 06, 2005 at 14:38:53 -0800,
Aaron Steele <asteele(at)berkeley(dot)edu> wrote:
> hi bruno,

Please copy replies to the list so that other people can help and learn
from your problem.

>
> here's the IF() from psql, although i'm not familiar enough to really
> know what to look for. do you see anything obviously wrong here? is
> there a better way to look at the IF() function?
> ........................................................................
> ......................................
> dmapdb=# \df+ if
>
> List of functions
> Result data type | Schema | Name | Argument data types | Owner |
> Language | Source code
> | Description
> ------------------+--------+------+---------------------+-------
> +----------
> +-----------------------------------------------------------------------
> -----------------------+-------------
> text | public | if | integer, text, text | dmap |
> plpgsql |
> BEGIN
> IF $1 THEN
> RETURN $2;
> END IF;
> IF NOT $1 THEN
> RETURN $3;
> END IF;
> END;

In the php code you showed the following fragment:
IF(l.last_comment_uid, cu.name, l.last_comment_name)

I doubt that l.last_comment_uid is a boolean based on its name.
If it isn't this is probably the source of your problem.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2005-01-06 23:57:33 Re: Global/persistent variables
Previous Message Bruno Wolff III 2005-01-06 22:27:42 Re: postgresql-contrib risks?