On Thu, Aug 26, 2010 at 1:47 PM, <wei725@lycos.com> wrote:
> I know what I need to do in the application for the change. My problem is that I don't know a good process to make a
suchchange in PostgreSQL. Since the application is in production already, do I need to create another field or convert
thedata from the boolean field into the new field?
recent versions of postgres allow you to do transformations w/alter table:
alter table foo alter bool_col type text using case when bool_col then
'foo' else 'bar' end;
expression can hook to a function if you want to do something really
complex (yes this is awesome) :-)
merlin