title: How to set default date on a field of a Postgres table?
body: <p><strong>How to add default date on postgresql?</strong></p>
  
  <p>I tried <code>getdate()</code> but the command gives a error:</p>
  
  <pre><code>ERROR: function getdate() does not exist
  SQL state: 42883
  Hint: No function matches the given name and argument types. You might need to add explicit type casts.
  </code></pre>
  
  <p>The command issued was:</p>
  
  <pre><code>Create TABLE CREATE_ORDERS (
  Plot_ID VARCHAR (50) ,
  USER_ID VARCHAR(50),
  ORDER_ID VARCHAR(50),
  TOTAL_AMOUNT float NOT NULL DEFAULT 0.000,
  DOWNPAYMENT float NOT NULL DEFAULT 25000,
  BALANCE_INSTALLMENT_AMOUNT float NOT NULL DEFAULT 0.000,
  NO_OF_INSTALLMENTS float NOT NULL DEFAULT 12,
  PURCHASE_DATE TIMESTAMP  NOT NULL DEFAULT GETDATE(),
  DUE_DATE TIMESTAMP  NOT NULL DEFAULT GETDATE(),
  CONSTRAINT AK_TransactionID1 UNIQUE(PLOT_ID),
  CONSTRAINT AK_TransactionID2 UNIQUE(ORDER_ID),
  PRIMARY KEY (PLOT_ID, ORDER_ID));
  </code></pre>