How to insert current date in postgresql?

Asked

Viewed 9,742 times

5

I need to set in a column on postgresql the current date of insertion as the default value for the field.

How can I do that?

  • See if it helps you: http://stackoverflow.com/questions/910763/how-to-set-a-postgresql-default-value-datestamp-like-yyyymm

2 answers

4


You can set the default value in column creation, for example:

my_date date not null default CURRENT_DATE

1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.