sql - How do I automatically update table columns while importing data in PostgreSQL? -
i have table my_table
layout follows (sample rows):
id start end 1 2010-05-29 11:22:00 2010-06-06 13:45:59 2 2010-04-03 01:15:00 2010-07-21 14:30:59 3 2010-05-02 16:12:00 2010-11-01 15:12:59
column id
of data type integer
while start
, end
columns in character varying(20)
. have database my_db
in postgresql 9.5 (x64) on windows 7 (x64) based machine. want change data type of start
, end columns
timestamp without time zone
. can achieved postgres command:
alter table my_table alter column start type timestamp without time zone using start::timestamp without time zone
however, update data type of these columns while importing data my_db
. wondering in postgresql possible update column data types when data imported (for example, when data imported via postgis shapefile/dbf loader or qgis db manager postgresql detects these data types automatically , changes them desired ones). if yes, can suggest me how automate such process?
Comments
Post a Comment