Created
November 12, 2011 17:33
-
-
Save mattwigway/1360850 to your computer and use it in GitHub Desktop.
Convert time varchar(19) to time::timestamp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE nextbus RENAME COLUMN time TO time_orig; -- save the old column | |
ALTER TABLE nextbus ADD COLUMN time timestamp; -- create the new column | |
UPDATE acrt.nextbus SET time = time_orig::timestamp; -- set the timestamps. This takes a VERY VERY LONG time; for a 395k point table, it took over 654 (!) seconds | |
ALTER TABLE nextbus DROP COLUMN time_orig; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment