This is a discussion on ALTER COLUMN from date to timestamp without time zone within the Pgsql General forums, part of the PostgreSQL category; --> I am trying to figure out how to alter a column's data type from a date to a timestamp ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I am trying to figure out how to alter a column's data type from a date to a timestamp without time zone. Is this possible or do I have to drop the column and then add it back with the correct data type? Below is the table: rpdb3=# \d reports Table "public.reports" Column | Type | Modifiers ----------------------+--------------+----------- day | date | not null hbt | character(2) | not null chain | character(2) | not null pass | integer | not null Indexes: "reports_pkey" primary key, btree ("day", hbt, chain) I need the table to be: rpdb3=# \d reports Table "public.reports" Column | Type | Modifiers ----------------------+--------------+----------- day | timestamp without time zone | not null hbt | character(2) | not null chain | character(2) | not null pass | integer | not null Indexes: "reports_pkey" primary key, btree ("day", hbt, chain) |