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:
[EMAIL PROTECTED]> create table timely (quand date);
CREATE TABLE
Time: 14.385 ms
[EMAIL PROTECTED]> insert into timely values ('1968-11-22');
INSERT 0 1
Time: 2.398 ms
[EMAIL PROTECTED]> insert into timely values (now());
INSERT 0 1
Time: 4.683 ms
[EMAIL PROTECTED]> select * from timely ;
quand
------------
1968-11-22
2006-07-25
(2 rows)
Time: 2.263 ms
[EMAIL PROTECTED]> alter table timely alter column quand type timestamp;
ALTER TABLE
Time: 39.002 ms
[EMAIL PROTECTED]> select * from timely ;
quand
---------------------
1968-11-22 00:00:00
2006-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
-- Reece Hart, http://harts.net/reece/, GPG:0x25EC91A0 |
