| From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
|---|---|
| To: | Eliana Gutierrez <egp1962(at)yahoo(dot)com(dot)au> |
| Cc: | ayuda postgres <pgsql-es-ayuda(at)postgresql(dot)org> |
| Subject: | Re: Cambio de tipo char a boolean |
| Date: | 2006-11-14 00:44:53 |
| Message-ID: | 20061114004453.GC22291@alvh.no-ip.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-es-ayuda |
Eliana Gutierrez escribi:
> Hola a todos, estoy tratando de cambiar un misero tipo de datos de
> char a boolean y no me deja, no se usar el USING, la documentacion es
> poco clara.
> Alguien me puede ayudar ??
alvherre=# create table foo (a char);
CREATE TABLE
alvherre=# insert into foo values ('t');
INSERT 17248 1
alvherre=# insert into foo values ('f');
INSERT 17249 1
alvherre=# insert into foo values ('a');
INSERT 17250 1
alvherre=# alter table foo alter column a type bool using case when a = 't' then true else false end;
ALTER TABLE
alvherre=# select * from foo;
a
---
t
f
f
(3 filas)
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Pedro Mateo | 2006-11-14 00:49:14 | Re: sobre herencias |
| Previous Message | PAUL ELGUERA MEZA | 2006-11-14 00:43:46 | Migracion de Sybase a Postgres |