Re: inserting boolean values in dynamic queries - Mailing list pgsql-sql

From Tom Lane
Subject Re: inserting boolean values in dynamic queries
Date
Msg-id 16326.1221741347@sss.pgh.pa.us
Whole thread Raw
In response to inserting boolean values in dynamic queries  ("Raphael Bauduin" <rblists@gmail.com>)
Responses Re: inserting boolean values in dynamic queries
List pgsql-sql
"Raphael Bauduin" <rblists@gmail.com> writes:
> EXECUTE 'UPDATE tbl SET '
>         || quote_ident(colname)
>         || ' = '
>         || quote_literal(newvalue)
>         || ' WHERE key = '
>         || quote_literal(keyvalue);

> It works fine, except when I want to include a boolean value: the cast
> of newvalue from boolean to text causes problem.

What problem?  'true' and 'false' are accepted as input for boolean
AFAICS.
        regards, tom lane


pgsql-sql by date:

Previous
From: "Rafael Domiciano"
Date:
Subject: Re: Doubts about FK
Next
From: "Raphael Bauduin"
Date:
Subject: Re: inserting boolean values in dynamic queries