I have a table tdummy2
, where I am importing the data from a csv file. Earlier I have set my create and update column as now()
to auto update the column with current timestamp.
I now wanted to have my data imported with date now()-interval '7 days'
and now-interval '30 days' etc.
This update needs to happen every different csv file import, meaning I have one csv data that should get update
as now()-interval '7 days'
and some csv file data as now()-interval -'14 days'
and so on.
How can I do this using a PostgreSQL database? Should I have to do it manually every time or is there any way I can update the column at the same time the import is going on?
My current table schema:
create table tdummy2 (
number1 integer,
digit integer,
type_digit integer,
total integer,
word character varying(256),
apk character varying(256),
version1 character varying(256),
created timestamp without time zone DEFAULT now() NOT NULL,
updated timestamp without time zone DEFAULT now() NOT NULL
);