RE: Problemas con tabla

From: "Romero, Fernando" <fromero(at)cferroviarios(dot)com(dot)ar>
To: "'gilberto(dot)castillo(at)etecsa(dot)cu'" <gilberto(dot)castillo(at)etecsa(dot)cu>
Cc: "pgsql-es-ayuda(at)postgresql(dot)org" <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: RE: Problemas con tabla
Date: 2014-10-21 19:35:23
Message-ID: 1F87E2EC3346654E977DFE08FCC44D118745EDF7@UGOMSMAIL01.ugoms.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Muchas gracias.

Saludos

 

-----Mensaje original-----
De: Gilberto Castillo [mailto:gilberto(dot)castillo(at)etecsa(dot)cu]
Enviado el: martes, 21 de octubre de 2014 05:33 p.m.
Para: Romero, Fernando
CC: 'gilberto(dot)castillo(at)etecsa(dot)cu'; pgsql-es-ayuda(at)postgresql(dot)org
Asunto: RE: [pgsql-es-ayuda] Problemas con tabla

> Si, por eso quiero cambiar la definición del campo y me tira el error
> del final
>
> dbtrabajos=# ALTER TABLE "public"."trabajos" ALTER COLUMN "valor"
> TYPE numeric(30);
> ERROR: la columna ▒valor▒ no puede convertirse autom▒ticamente al
> tipo numeric
> SUGERENCIA: Especifique una expresi▒n USING para llevar a cabo la
> conversi▒n.

Para ello, lee la ayuda de esa orden.

Ahora puedes dejar tu definición y hacer cast de ese campo algo como

select sum(valor::integer) from tu_tabl;

Saludos,
Gilberto Castillo
La Habana, Cuba
-
Enviado a la lista de correo pgsql-es-ayuda (pgsql-es-ayuda(at)postgresql(dot)org)
Para cambiar tu suscripcin:
http://www.postgresql.org/mailpref/pgsql-es-ayuda

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Carlos Chapi 2014-10-21 19:35:38 Re: Problemas con tabla
Previous Message Romero, Fernando 2014-10-21 19:30:56 RE: Problemas con tabla