On Tue, 2006-07-25 at 17:21 -0500, MC Moisei wrote:
The main thing is I changed a bunch of date types to timestamp type. Is
there a simple way to change the type on such fields ?
Yes, and more generally to change the type of a column. See below:
rkh@csb-dev=> create table timely (quand date);
CREATE TABLE
Time: 14.385 ms
rkh@csb-dev=> insert into timely values ('1968-11-22');
INSERT 0 1
Time: 2.398 ms
rkh@csb-dev=> insert into timely values (now());
INSERT 0 1
Time: 4.683 ms
rkh@csb-dev=> select * from timely ;
quand
------------1968-11-222006-07-25
(2 rows)
Time: 2.263 ms
rkh@csb-dev=> alter table timely alter column quand type timestamp;
ALTER TABLE
Time: 39.002 ms
rkh@csb-dev=> select * from timely ;
quand
---------------------1968-11-22 00:00:002006-07-25 00:00:00
(2 rows)
Time: 1.457 ms
Similarly, try 'alter table timely rename column quand to cuando' .
Also: \h alter table