pg_online_schema_change 0.9.7 → 0.9.9

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
  SHA256:
3
- metadata.gz: e1838409c592e1497790a6e02f883b857851450181854baf660b9b7ee3664c6e
4
- data.tar.gz: 4f7e58eeafb2413ec774988b3190391033e819a444a25da3b1ff0fcbf6bf64e4
3
+ metadata.gz: e19d4d76c1e353f68cf4d3b2445e2d33ebcf5a9f3a5c1f0e11df7097f424922e
4
+ data.tar.gz: 6cc247ef07804aa1d9edf24d057013b8e697583a13c59d212eb7c816210ac5b1
5
5
  SHA512:
6
- metadata.gz: c769f18ab1815fa543246fd18bb3157add074894f15371abb88e1af61e9381eade6850e4fba3a7d6d3701711594ed10a9018c7fe1c45a5ffdaf501891bf7e548
7
- data.tar.gz: 84667ac77dab1d97478d51d9635dfcacd38e23ffe59ef6171863ca52d69294af19672bd89dba49a6d325b1c64c4e76a5dc8c57bf3dfee1120e2bd4bec1ca9e21
6
+ metadata.gz: 61a3ffd9f77ade00ca8818b66c5415152ef570eb4581f92a69d7ce67fb60042362021995fd7653b73f78a95f1b793d6f39ae5d3831a014fd365cd0102c5954aa
7
+ data.tar.gz: e26f96ef36a0147d533651d0193bdd5fd680b72b973f6d50db5246d65217ff982c233259eb8724c9d223d15bbdaae57c78f916b08c2b94f51a56a8ab92964678
data/.rubocop.yml CHANGED
@@ -215,6 +215,9 @@ RSpec/DescribeClass:
215
215
  RSpec/DescribedClass:
216
216
  Enabled: false
217
217
 
218
+ Rspec/FilePath:
219
+ Enabled: false
220
+
218
221
  RSpec/SpecFilePathFormat:
219
222
  Enabled: false
220
223
 
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.3
1
+ 3.3.0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.9.8] - 2024-01-15
2
+
3
+ - Dependency updates
4
+
5
+ ## [0.9.7] - 2024-01-15
6
+
7
+ - Introduce the ability to show estimated progress of copy - #146
8
+
1
9
  ## [0.9.6] - 2023-11-04
2
10
 
3
11
  - Fix and add links to caveats section in #130
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pg_online_schema_change (0.9.7)
4
+ pg_online_schema_change (0.9.9)
5
5
  ougai (~> 2.0.0)
6
6
  pg (>= 1.3.2, < 1.6.0)
7
7
  pg_query (>= 2.1.3, < 4.3.0)
@@ -10,82 +10,92 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
+ abbrev (0.1.2)
13
14
  ast (2.4.2)
14
- bigdecimal (3.1.5)
15
+ bigdecimal (3.1.8)
15
16
  coderay (1.1.3)
16
- diff-lcs (1.5.0)
17
- google-protobuf (3.25.2-arm64-darwin)
18
- google-protobuf (3.25.2-x86_64-linux)
19
- haml (6.1.1)
17
+ diff-lcs (1.5.1)
18
+ google-protobuf (4.28.2-arm64-darwin)
19
+ bigdecimal
20
+ rake (>= 13)
21
+ google-protobuf (4.28.2-x86_64-linux)
22
+ bigdecimal
23
+ rake (>= 13)
24
+ haml (6.3.0)
20
25
  temple (>= 0.8.2)
21
26
  thor
22
27
  tilt
23
- json (2.6.3)
28
+ json (2.7.1)
24
29
  language_server-protocol (3.17.0.3)
25
30
  method_source (1.0.0)
26
- oj (3.16.3)
31
+ oj (3.16.6)
27
32
  bigdecimal (>= 3.0)
33
+ ostruct (>= 0.2)
34
+ ostruct (0.6.0)
28
35
  ougai (2.0.0)
29
36
  oj (~> 3.10)
30
- parallel (1.23.0)
31
- parser (3.2.2.4)
37
+ parallel (1.24.0)
38
+ parser (3.3.0.4)
32
39
  ast (~> 2.4.1)
33
40
  racc
34
- pg (1.5.4)
41
+ pg (1.5.8)
35
42
  pg_query (4.2.3)
36
43
  google-protobuf (>= 3.22.3)
37
44
  prettier_print (1.2.1)
38
45
  pry (0.14.2)
39
46
  coderay (~> 1.1)
40
47
  method_source (~> 1.0)
41
- racc (1.7.1)
48
+ racc (1.7.3)
42
49
  rainbow (3.1.1)
43
50
  rake (13.1.0)
44
- rbs (3.1.0)
45
- regexp_parser (2.8.2)
46
- rexml (3.2.6)
47
- rspec (3.12.0)
48
- rspec-core (~> 3.12.0)
49
- rspec-expectations (~> 3.12.0)
50
- rspec-mocks (~> 3.12.0)
51
- rspec-core (3.12.2)
52
- rspec-support (~> 3.12.0)
53
- rspec-expectations (3.12.3)
51
+ rbs (3.4.1)
52
+ abbrev
53
+ regexp_parser (2.9.0)
54
+ rexml (3.3.6)
55
+ strscan
56
+ rspec (3.13.0)
57
+ rspec-core (~> 3.13.0)
58
+ rspec-expectations (~> 3.13.0)
59
+ rspec-mocks (~> 3.13.0)
60
+ rspec-core (3.13.1)
61
+ rspec-support (~> 3.13.0)
62
+ rspec-expectations (3.13.3)
54
63
  diff-lcs (>= 1.2.0, < 2.0)
55
- rspec-support (~> 3.12.0)
56
- rspec-mocks (3.12.5)
64
+ rspec-support (~> 3.13.0)
65
+ rspec-mocks (3.13.2)
57
66
  diff-lcs (>= 1.2.0, < 2.0)
58
- rspec-support (~> 3.12.0)
59
- rspec-support (3.12.0)
60
- rubocop (1.57.2)
67
+ rspec-support (~> 3.13.0)
68
+ rspec-support (3.13.1)
69
+ rubocop (1.60.0)
61
70
  json (~> 2.3)
62
71
  language_server-protocol (>= 3.17.0)
63
72
  parallel (~> 1.10)
64
- parser (>= 3.2.2.4)
73
+ parser (>= 3.3.0.2)
65
74
  rainbow (>= 2.2.2, < 4.0)
66
75
  regexp_parser (>= 1.8, < 3.0)
67
76
  rexml (>= 3.2.5, < 4.0)
68
- rubocop-ast (>= 1.28.1, < 2.0)
77
+ rubocop-ast (>= 1.30.0, < 2.0)
69
78
  ruby-progressbar (~> 1.7)
70
79
  unicode-display_width (>= 2.4.0, < 3.0)
71
80
  rubocop-ast (1.30.0)
72
81
  parser (>= 3.2.1.0)
73
- rubocop-capybara (2.18.0)
82
+ rubocop-capybara (2.20.0)
83
+ rubocop (~> 1.41)
84
+ rubocop-factory_bot (2.25.1)
74
85
  rubocop (~> 1.41)
75
- rubocop-factory_bot (2.23.1)
76
- rubocop (~> 1.33)
77
86
  rubocop-packaging (0.5.2)
78
87
  rubocop (>= 1.33, < 2.0)
79
- rubocop-performance (1.19.1)
80
- rubocop (>= 1.7.0, < 2.0)
81
- rubocop-ast (>= 0.4.0)
88
+ rubocop-performance (1.20.2)
89
+ rubocop (>= 1.48.1, < 2.0)
90
+ rubocop-ast (>= 1.30.0, < 2.0)
82
91
  rubocop-rake (0.6.0)
83
92
  rubocop (~> 1.0)
84
- rubocop-rspec (2.24.0)
85
- rubocop (~> 1.33)
93
+ rubocop-rspec (2.26.1)
94
+ rubocop (~> 1.40)
86
95
  rubocop-capybara (~> 2.17)
87
96
  rubocop-factory_bot (~> 2.22)
88
97
  ruby-progressbar (1.13.0)
98
+ strscan (3.1.0)
89
99
  syntax_tree (6.2.0)
90
100
  prettier_print (>= 1.2.0)
91
101
  syntax_tree-haml (4.0.3)
@@ -96,15 +106,16 @@ GEM
96
106
  prettier_print
97
107
  rbs
98
108
  syntax_tree (>= 2.0.1)
99
- temple (0.10.0)
100
- thor (1.3.0)
101
- tilt (2.1.0)
109
+ temple (0.10.3)
110
+ thor (1.3.2)
111
+ tilt (2.3.0)
102
112
  unicode-display_width (2.5.0)
103
113
 
104
114
  PLATFORMS
105
115
  arm64-darwin-20
106
116
  arm64-darwin-21
107
117
  arm64-darwin-22
118
+ arm64-darwin-23
108
119
  x86_64-linux
109
120
 
110
121
  DEPENDENCIES
data/README.md CHANGED
@@ -60,7 +60,6 @@ https://hub.docker.com/r/shayonj/pg-osc
60
60
  ## Requirements
61
61
 
62
62
  - PostgreSQL 9.6 and later
63
- - Ruby 2.6 and later
64
63
  - Database user should have permissions for `TRIGGER` and/or a `SUPERUSER`
65
64
 
66
65
  ## Usage
@@ -257,14 +256,14 @@ docker run --network host -it --rm shayonj/pg-osc:latest \
257
256
 
258
257
  ## Development
259
258
 
260
- - Install ruby 3.1.3
259
+ - Install ruby 3.3.0
261
260
 
262
261
  ```
263
262
  \curl -sSL https://get.rvm.io | bash
264
263
 
265
- rvm install 3.1.3
264
+ rvm install 3.3.0
266
265
 
267
- rvm use 3.1.3
266
+ rvm use 3.3.0
268
267
  ```
269
268
 
270
269
  - Spin up postgres via Docker Compose - `docker compose up`
@@ -54,6 +54,10 @@ module PgOnlineSchemaChange
54
54
  raise Error, "Not a valid ALTER statement: #{@alter_statement}"
55
55
  end
56
56
 
57
+ if delta_count > pull_batch_count
58
+ raise Error, "Value for delta_count should be smaller than the value for pull_batch_count"
59
+ end
60
+
57
61
  return if Query.same_table?(@alter_statement)
58
62
 
59
63
  raise Error, "All statements should belong to the same table: #{@alter_statement}"
@@ -16,7 +16,7 @@ module PgOnlineSchemaChange
16
16
  sql = <<~SQL
17
17
  SET statement_timeout = 0;
18
18
  SET client_min_messages = warning;
19
- SET search_path TO #{client.schema};
19
+ SET search_path TO "#{client.schema}";
20
20
  SQL
21
21
 
22
22
  Query.run(client.connection, sql)
@@ -301,13 +301,13 @@ module PgOnlineSchemaChange
301
301
  def run_analyze!
302
302
  logger.info("Performing ANALYZE!")
303
303
 
304
- client.connection.async_exec("ANALYZE VERBOSE #{client.schema}.#{client.table_name};")
304
+ client.connection.async_exec("ANALYZE VERBOSE \"#{client.schema}\".#{client.table_name};")
305
305
  end
306
306
 
307
307
  def run_vacuum!
308
308
  logger.info("Performing VACUUM!")
309
309
 
310
- client.connection.async_exec("VACUUM VERBOSE #{client.schema}.#{client.table_name};")
310
+ client.connection.async_exec("VACUUM VERBOSE \"#{client.schema}\".#{client.table_name};")
311
311
  end
312
312
 
313
313
  def validate_constraints!
@@ -66,7 +66,7 @@ module PgOnlineSchemaChange
66
66
  end
67
67
  end
68
68
 
69
- def run(connection, query, reuse_trasaction = false, &block)
69
+ def run(connection, query, reuse_trasaction = false, &block) # rubocop:disable Style/ArgumentsForwarding
70
70
  if [PG::PQTRANS_INERROR, PG::PQTRANS_UNKNOWN].include?(connection.transaction_status)
71
71
  connection.cancel
72
72
  end
@@ -75,7 +75,7 @@ module PgOnlineSchemaChange
75
75
 
76
76
  connection.async_exec("BEGIN;")
77
77
 
78
- result = connection.async_exec(query, &block)
78
+ result = connection.async_exec(query, &block) # rubocop:disable Style/ArgumentsForwarding
79
79
  rescue Exception # rubocop:disable Lint/RescueException
80
80
  connection.cancel if connection.transaction_status != PG::PQTRANS_IDLE
81
81
  connection.block
@@ -328,7 +328,7 @@ module PgOnlineSchemaChange
328
328
  run(client.connection, query) do |result|
329
329
  definitions =
330
330
  result.map do |row|
331
- { "#{row["schema_name"]}.#{row["view_name"]}" => row["view_definition"].strip }
331
+ { "\"#{row["schema_name"]}\".#{row["view_name"]}" => row["view_definition"].strip }
332
332
  end
333
333
  end
334
334
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgOnlineSchemaChange
4
- VERSION = "0.9.7"
4
+ VERSION = "0.9.9"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_online_schema_change
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.7
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shayon Mukherjee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-15 00:00:00.000000000 Z
11
+ date: 2024-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ougai
@@ -318,7 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
318
318
  - !ruby/object:Gem::Version
319
319
  version: '0'
320
320
  requirements: []
321
- rubygems_version: 3.3.26
321
+ rubygems_version: 3.5.3
322
322
  signing_key:
323
323
  specification_version: 4
324
324
  summary: Easy CLI tool for making non-blocking zero downtime schema changes in PostgreSQL