title: Is it possible to set timestamp with 30 minute from current_timestamp default value column when loading CSV?
body: <p>I have a timestamp field <code>insert_time</code> that is defined to be automatically updated with the CURRENT_TIMESTAMP value.</p>
  <p>It works fine if I define the value below while importing civ to PostgresDB.</p>
  <ol>
  <li><p>Give timestamp column as <code>now()</code> function in csv</p>
  </li>
  <li><p>Manually enter timestamp like <code>2013-08-08</code> in the csv</p>
  </li>
  </ol>
  <p>As current condition I would like to insert timestamp with 30 minutes from the current_timestamp, so I simply put</p>
  <p><code>NOW()-INTERVAL'30 MINUTES'</code>, and the system returns me error with statements below.</p>
  <blockquote>
  <p>InvalidDatetimeFormat: invalid input syntax for type timestamp:
  &quot;(NOW() - INTERVAL '30 MINUTES')&quot;
  CONTEXT:  COPY trade, line 1, column insert_time: &quot;(NOW() - INTERVAL '30 MINUTES')&quot;.</p>
  </blockquote>
  <p>Is there any workaround I can simply use to import data without changing code base to do so?</p>
  <p><a href="https://i.stack.imgur.com/ei4Q1.jpg" rel="nofollow noreferrer">DB Table properties</a></p>
  <p>Sample of CSV:</p>
  <pre><code>c3f94bdf-8854-49d2-833d-0690eb821bdf,2290736458974872576,c3f94bdf-8854-49d2-833d-0690eb821bdf,10,40000000,BTC,2290736449804431425,2022030100,1646106066455,10,40000000,BTC,8,4000000000,USDT,c3f94bdf-8854-49d2-833d-0690eb821bde,8,4000000000,USDT,2290736443845317312,27729472,&quot;19447008-1&quot;,A,BTC_USDT,BUY,1646106066455,2,600000,6,1000000,1646106066455,sample_trade,sample_trade,NOW() - INTERVAL '30 MINUTE'
  c3f94bdf-8854-49d2-833d-0690eb821bd2,2290735086865954176,c3f94bdf-8854-49d2-833d-0690eb821bd2,10,40000000,ETH,2290735071284965826,2022030100,1646106025563,10,40000000,ETH,8,4000000000,USDT,c3f94bdf-8854-49d2-833d-0690eb821bde,8,4000000000,USDT,2290735065371963840,27727648,&quot;19445792-0&quot;,A,ETH_USDT,BUY,1646106025563,2,1000000,6,1000000,1646106025563,sample_trade,sample_trade,NOW() - INTERVAL '30 MINUTE'
  c3f94bdf-8854-49d2-833d-0690eb821bd3,2290728307695304704,c3f94bdf-8854-49d2-833d-0690eb821bd3,10,40000000,VET,2290728283028522497,2022030100,1646105823528,10,40000000,VET,8,4000000000,USDT,c3f94bdf-8854-49d2-833d-0690eb821bde,8,4000000000,USDT,2290728277231940960,27725824,&quot;19444576-1&quot;,A,VET_USDT,BUY,1646105823528,2,1000000,6,1000000,1646105823528,sample_trade,sample_trade,NOW() - INTERVAL '30 MINUTE'
  c3f94bdf-8854-49d2-833d-0690eb821bd4,2290722365598402272,c3f94bdf-8854-49d2-833d-0690eb821bd4,10,40000000,LUNA,2290722340448397249,2022030100,1646105646440,10,40000000,LUNA,8,4000000000,USDT,c3f94bdf-8854-49d2-833d-0690eb821bde,8,4000000000,USDT,2290722334488401536,27724000,&quot;19443360-8&quot;,A,LUNA_USDT,BUY,1646105646440,2,1000000,6,1000000,1646105646440,sample_trade,sample_trade,NOW() - INTERVAL '30 MINUTE'
  c3f94bdf-8854-49d2-833d-0690eb821bd5,2290589190301423232,c3f94bdf-8854-49d2-833d-0690eb821bd5,10,74800000,ADA,2290589095070535169,2022030100,1646101677507,10,74800000,ADA,8,4000000000,USDT,c3f94bdf-8854-49d2-833d-0690eb821bde,8,4000000000,USDT,2290589120065645888,22440128,&quot;16738528-1&quot;,A,ADA_USDT,SELL,1646101677507,2,600000,6,1870000,1646101677507,sample_trade,sample_trade,NOW() - INTERVAL '30 MINUTE'
  c3f94bdf-8854-49d2-833d-0690eb821bd6,2290584188362083520,c3f94bdf-8854-49d2-833d-0690eb821bd6,10,40000000,MANA,2290584186822704929,2022030100,1646101528437,10,40000000,MANA,8,4000000000,USDT,c3f94bdf-8854-49d2-833d-0690eb821bde,8,4000000000,USDT,2290584180756419392,22409120,&quot;16708128-0&quot;,A,MANA_USDT,BUY,1646101528437,2,600000,6,1000000,1646101528437,sample_trade,sample_trade,NOW() - INTERVAL '30 MINUTE'
  c3f94bdf-8854-49d2-833d-0690eb821bd7,2290582829397526912,c3f94bdf-8854-49d2-833d-0690eb821bd7,10,40000000,BUSD,2290582809255269282,2022030100,1646101487937,10,40000000,BUSD,8,4000000000,USDT,c3f94bdf-8854-49d2-833d-0690eb821bde,8,4000000000,USDT,2290582803356323808,22407296,&quot;16706912-0&quot;,A,BUSD_USDT,BUY,1646101487937,2,1000000,6,1000000,1646101487937,sample_trade,sample_trade,NOW() - INTERVAL '30 MINUTE'
  c3f94bdf-8854-49d2-833d-0690eb821bd8,2290579188400153888,c3f94bdf-8854-49d2-833d-0690eb821bd8,10,40000000,AAVE,2290579149684042434,2022030100,1646101379427,10,40000000,AAVE,8,4000000000,USDT,c3f94bdf-8854-49d2-833d-0690eb821bde,8,4000000000,USDT,2290579143738594816,22405472,&quot;16705696-0&quot;,A,AAVE_USDT,BUY,1646101379427,2,1000000,6,1000000,1646101379427,sample_trade,sample_trade,NOW() - INTERVAL '30 MINUTE'
  c3f94bdf-8854-49d2-833d-0690eb821bd9,2290576756852686496,c3f94bdf-8854-49d2-833d-0690eb821bd9,10,40000000,ETH,2290576726140179970,2022030100,1646101306961,10,40000000,ETH,8,4000000000,USDT,c3f94bdf-8854-49d2-833d-0690eb821bde,8,4000000000,CRO,2290576720287178368,22403648,&quot;16704480-0&quot;,A,ETH_CRO,BUY,1646101306961,2,1000000,6,1000000,1646101306961,sample_trade,sample_trade,NOW() - INTERVAL '30 MINUTE'
  c3f94bdf-8854-49d2-833d-0690eb821aa1,2290574614735494369,c3f94bdf-8854-49d2-833d-0690eb821aa1,10,40000000,MANA,2290574580787974626,2022030100,1646101243121,10,40000000,MANA,8,4000000000,USDT,c3f94bdf-8854-49d2-833d-0690eb821bde,8,4488000000,CRO,2290574606968299904,22401216,&quot;16703072-1&quot;,A,MANA_CRO,SELL,1646101243121,2,600000,6,1870000,1646101243121,sample_trade,sample_trade,NOW() - INTERVAL '30 MINUTE'
  </code></pre>
  <p>Data import source code</p>
  <pre><code>@keyword(&quot;Import trade data to db&quot;)
  def import_trade_data():
      _connection = init_database_connection()
      _nts_connection = init_nts_database_connection()
  
  print(f'Connecting to {pg_host}:{pg_port} db {pg_db} with user {pg_user}')
  import_file = f'{os.getcwd()}/data/import_trade_data.table'
  
  cur = _connection.cursor()
  
  if os.path.isfile(import_file):
      import_file1 = open(import_file, 'r')
      trade_tables = import_file1.readlines()
  
  print('import data')
  # import data
  for data in trade_tables:
      data = str.rstrip(data)
      table_file = f'{os.getcwd()}/data/trade.csv'
      if os.path.isfile(table_file):
          print(f'loading {table_file}')
          f = open(table_file)
          cur.copy_from(file=f, table=data, sep=',')
          _connection.commit()
      else:
          print(f'Expected table file {table_file} not found')
  write_to_console(f'Data is imported: {cur.rowcount}')
  
  print('update data')
  
  cur.execute(f&quot;update exchange_order set source_sequence = 0 where status in ('ACTIVE', 'PENDING');&quot;)
  cur.execute(f'update balance set source_sequence = 0 where source_sequence != 0;')
  cur.execute(f'update event_source_sequence set last_sequence = 0;')
  cur.execute(f'update event_source_sequence set related_id = 0;')
  _connection.commit()
  </code></pre>