[GENERAL] date with month and year

2015-05-21 Thread Daniel Torres
I everybody, I'm new in the Postgresql world, and have an easy question: Is it possible to have date type data that only contain month and year?, how can I obtain that from a timestamp (without time zone) column? I've made this, but I think the result is a text, not a date select extract (Year fr

Re: [GENERAL] date with month and year

2015-05-21 Thread Daniel Torres
Sorry, forgot to told you what I'm trying, I have climate data and want to obtain mean temperature and total precipitation and that sort of things per month and year. Think date_trunc is a good solution, but any other advice would be very welcome. (I need to read more about time zones, I'm new at

[GENERAL] change data type from text to numeric

2014-11-26 Thread Daniel Torres
Hi everyone, sorry to bother you with a simple question, (I'm a new user of postgresql), how do I change the data type of a column of text, to numeric or integer? I tried with: ALTER TABLE table_name ALTER COLUMN col_name TYPE integer ; It gives me a mistake ERROR: la columna no puede conver