Re: inserting boolean values in dynamic queries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Raphael Bauduin" <rblists(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: inserting boolean values in dynamic queries
Date: 2008-09-18 12:35:47
Message-ID: 16326.1221741347@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-sql

"Raphael Bauduin" <rblists(at)gmail(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Raphael Bauduin 2008-09-18 13:53:50 Re: inserting boolean values in dynamic queries
Previous Message Rafael Domiciano 2008-09-18 11:49:20 Re: Doubts about FK