Skip to content

Instantly share code, notes, and snippets.

@bliiir
Created November 18, 2018 15:27
Show Gist options
  • Select an option

  • Save bliiir/5cb0b360ace7b43986990f903baca8c8 to your computer and use it in GitHub Desktop.

Select an option

Save bliiir/5cb0b360ace7b43986990f903baca8c8 to your computer and use it in GitHub Desktop.

Revisions

  1. bliiir created this gist Nov 18, 2018.
    20 changes: 20 additions & 0 deletions INSERT.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    INSERT INTO bucket(
    market_id,
    timeframe_id,
    time_close,
    price_open,
    price_high,
    price_low,
    price_close,
    volume)
    SELECT
    market_id,
    timeframe_id,
    time_close,
    price_open,
    price_high,
    price_low,
    price_close,
    volume
    FROM bucket_temp
    ON CONFLICT (market_id, timeframe_id, time_close) DO NOTHING;