Re: [SQL] inserting boolean values in dynamic queries

2008-09-18 Thread Tom Lane
"Raphael Bauduin" <[EMAIL PROTECTED]> writes: > --> ERROR: function quote_literal(boolean) does not exist Oh, you must be using some version that didn't have a bool->text cast. I'd suggest making one. Or just make a quote_literal(boolean) function. regards, tom lane --

Re: [SQL] inserting boolean values in dynamic queries

2008-09-18 Thread Raphael Bauduin
On Thu, Sep 18, 2008 at 2:35 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Raphael Bauduin" <[EMAIL PROTECTED]> writes: >> EXECUTE 'UPDATE tbl SET ' >> || quote_ident(colname) >> || ' = ' >> || quote_literal(newvalue) >> || ' WHERE key = ' >> || quote_literal(ke

Re: [SQL] inserting boolean values in dynamic queries

2008-09-18 Thread Tom Lane
"Raphael Bauduin" <[EMAIL PROTECTED]> 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

[SQL] inserting boolean values in dynamic queries

2008-09-18 Thread Raphael Bauduin
Hi, I'm building a dynamic query as described at http://www.postgresql.org/docs/8.3/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN : EXECUTE 'UPDATE tbl SET ' || quote_ident(colname) || ' = ' || quote_literal(newvalue) || ' WHERE key = '