pgslice 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1fbf523156daf638be0cf5de6a77c4c2ed4375ab
4
- data.tar.gz: fa1839b58db3046ab8e4705a410c7c7e3d99a86a
3
+ metadata.gz: af9d8b9872b5d7331a998243e48e9e9dd4f3a56f
4
+ data.tar.gz: edd651dc51c49176345a90515d852a936e8b696e
5
5
  SHA512:
6
- metadata.gz: 697401d7e40ad0db4f7be59d2a0e711b8f1e57c7c3efdf8874d4ed29f915bf5e98bc967e6f6199990a53853796e214f21cfbfe0961bd504defa8143124f0163a
7
- data.tar.gz: bc09c5daebc448a40aace451e80733a15f5d1ef6443e7f3fb7a5d7d82f3fee444b4e918c9b08dd6f80ec82a956ab5882a11d5997438025e4d394a0fe0b5b89b3
6
+ metadata.gz: e521baa2ab4d83fbaff40781b1b1a0e49500ca0cc5d1a37a2decb9764f7cc7f2568815961b6212a7e6e0665c83a8ac42d642261d702ed34a3ef454a57341bf5f
7
+ data.tar.gz: 66d0e6a38534f4e15ac6d607958823ca4b55ccad80be22351fa7c7085121d049583254e1637e051020e4190622e9a8d2e03bad0dc06cdd8dd8908a44331cd425
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.3.1
2
+
3
+ - Fixed exception with `--no-partition` option
4
+ - Use proper cast type in `fill` method for legacy `timestamptz` columns
5
+
1
6
  ## 0.3.0
2
7
 
3
8
  - Better query performance for `timestamptz` columns
data/lib/pgslice.rb CHANGED
@@ -52,7 +52,6 @@ module PgSlice
52
52
 
53
53
  def prep
54
54
  table, column, period = arguments
55
- cast = column_cast(table, column)
56
55
  intermediate_table = "#{table}_intermediate"
57
56
  trigger_name = self.trigger_name(table)
58
57
 
@@ -92,6 +91,7 @@ CREATE TRIGGER #{trigger_name}
92
91
  FOR EACH ROW EXECUTE PROCEDURE #{trigger_name}();
93
92
  SQL
94
93
 
94
+ cast = column_cast(table, column)
95
95
  queries << <<-SQL
96
96
  COMMENT ON TRIGGER #{trigger_name} ON #{intermediate_table} is 'column:#{column},period:#{period},cast:#{cast}';
97
97
  SQL
@@ -262,7 +262,6 @@ CREATE OR REPLACE FUNCTION #{trigger_name}()
262
262
  starting_id = max_dest_id
263
263
  fields = columns(source_table).map { |c| PG::Connection.quote_ident(c) }.join(", ")
264
264
  batch_size = options[:batch_size]
265
- cast = column_cast(table, field)
266
265
 
267
266
  i = 1
268
267
  batch_count = ((max_source_id - starting_id) / batch_size.to_f).ceil
@@ -485,7 +484,6 @@ INSERT INTO #{dest_table} (#{fields})
485
484
  end
486
485
 
487
486
  def min_id(table, primary_key, column, cast, starting_time, where)
488
- cast = column_cast(table, column)
489
487
  query = "SELECT MIN(#{primary_key}) FROM #{table}"
490
488
  conditions = []
491
489
  conditions << "#{column} >= #{sql_date(starting_time, cast)}" if starting_time
@@ -1,3 +1,3 @@
1
1
  module PgSlice
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgslice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-13 00:00:00.000000000 Z
11
+ date: 2016-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop