Re: PSql won't Let me Set Varchar Column to 'true'

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: Hunter Hillegas <lists(at)lastonepicked(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: PSql won't Let me Set Varchar Column to 'true'
Date: 2004-08-28 00:08:11
Message-ID: 87pt5cw2dw.fsf@asmodeus.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hunter Hillegas <lists(at)lastonepicked(dot)com> writes:

> I have two varchars on my table...
>
> I tried to run the following:
>
> VMGEngine=# update user_account set editor_status = 'true' and
> administrator_status = 'true' where rec_num = 20;
> ERROR: column "editor_status" is of type character varying but expression
> is of type boolean

That's odd. What version of PG is this?

> I was expecting the single quotes to tell psql to treat the data as a
> string, not a constant boolean value.
>
> Can I coerce psql to do what I would like it to?

An explicit cast might work:

set editor_status = 'true'::text

Why aren't you using booleans anyway? PG knows better than you. :)

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2004-08-28 00:13:27 Re: PSql won't Let me Set Varchar Column to 'true'
Previous Message Hunter Hillegas 2004-08-27 23:58:08 PSql won't Let me Set Varchar Column to 'true'