I created a table in postgres from samples I found on the internet. The definition of the column stored
is:
stored | timestamp without time zone | default '2014-04-11 21:19:20.144487'::timestamp without time zone
How do I alter this to be a "normal" timestamp now() type? So it will stamp the current date-time when inserting data?
Thank you all in advance!
If you're trying to change the default value . . .
alter table your-table-name
alter column stored set default current_timestamp
For changing the field type and default value the syntax will be ...
alter table your-table-name
alter column your-field type timestamp,
alter column your-field set default current_timestamp;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With