pg 1.5.0-x64-mingw32 → 1.5.2-x64-mingw32

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: 275ef74f3d21374b1c9c040b940a09f9cce70a448a39bb9883c4a1ae002e58df
4
- data.tar.gz: 6df498338befd331531fdf4b75568d11d85465fe1bb522f5a0ae9ff7d469498d
3
+ metadata.gz: 965a62aeee6293e1d8b76d2b018024b31d2e540b83d8930bb480d521cc7598b1
4
+ data.tar.gz: a977824a52ab4844710e172b05290f47a6c8a49011eb8bb271a1af6703cdd87f
5
5
  SHA512:
6
- metadata.gz: d6909feadaa5f3d024d7bfe3514b89e8f0541b9f089a4e52ff334741bc600d01501cea2dc9cc45c900b3176f6f7add4a5b7b411658fe0d1d50b619f78079e30f
7
- data.tar.gz: 60d044fd48b68fce0be3c8b2c22a1a43be789eb131e8da5924b1d582ffc280b414356fb7467c7e2b0e5a6a16c4613dde055ff2911b454379b4e9ab76300da085
6
+ metadata.gz: 3785d9a94845341b98b9ec0f2e72576057007b8e19512124f012b06ca717ef36064e8fae2c4e089e10e32f71be3cbe3bdc5b73fae8ad74b6481162db09923879
7
+ data.tar.gz: e68123f60f991a7fe108ce26992d5b1e32abf6eca0b125fb7a7230264b4ce981f12707dfd15cd3fba8ab4bd7747c8f443401df0f1e4c435e7ac87b4c29471080
checksums.yaml.gz.sig CHANGED
Binary file
data/History.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v1.5.1 [2023-04-24] Lars Kanis <lars@greiz-reinsdorf.de>
2
+
3
+ - Don't overwrite flags of timestamp coders. [#524](https://github.com/ged/ruby-pg/pull/524)
4
+ Fixes a regression in rails: https://github.com/rails/rails/issues/48049
5
+
6
+
1
7
  ## v1.5.0 [2023-04-24] Lars Kanis <lars@greiz-reinsdorf.de>
2
8
 
3
9
  Enhancements:
@@ -7,19 +7,19 @@ module PG
7
7
  class TimestampUtc < Timestamp
8
8
  def initialize(hash={}, **kwargs)
9
9
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
10
- super(flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_UTC, **hash, **kwargs)
10
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_UTC)
11
11
  end
12
12
  end
13
13
  class TimestampUtcToLocal < Timestamp
14
14
  def initialize(hash={}, **kwargs)
15
15
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
16
- super(flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_LOCAL, **hash, **kwargs)
16
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_LOCAL)
17
17
  end
18
18
  end
19
19
  class TimestampLocal < Timestamp
20
20
  def initialize(hash={}, **kwargs)
21
21
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
22
- super(flags: PG::Coder::TIMESTAMP_DB_LOCAL | PG::Coder::TIMESTAMP_APP_LOCAL, **hash, **kwargs)
22
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_LOCAL | PG::Coder::TIMESTAMP_APP_LOCAL)
23
23
  end
24
24
  end
25
25
  end
@@ -7,13 +7,13 @@ module PG
7
7
  class TimestampUtc < Timestamp
8
8
  def initialize(hash={}, **kwargs)
9
9
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
10
- super(flags: PG::Coder::TIMESTAMP_DB_UTC, **hash, **kwargs)
10
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC)
11
11
  end
12
12
  end
13
13
  class TimestampLocal < Timestamp
14
14
  def initialize(hash={}, **kwargs)
15
15
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
16
- super(flags: PG::Coder::TIMESTAMP_DB_LOCAL, **hash, **kwargs)
16
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_LOCAL)
17
17
  end
18
18
  end
19
19
  end
data/lib/pg/connection.rb CHANGED
@@ -166,6 +166,14 @@ class PG::Connection
166
166
  # conn.put_copy_data ['more', 'data', 'to', 'copy']
167
167
  # end
168
168
  #
169
+ # Also PG::BinaryEncoder::CopyRow can be used to send data in binary format to the server.
170
+ # In this case copy_data generates the header and trailer data automatically:
171
+ # enco = PG::BinaryEncoder::CopyRow.new
172
+ # conn.copy_data "COPY my_table FROM STDIN (FORMAT binary)", enco do
173
+ # conn.put_copy_data ['some', 'data', 'to', 'copy']
174
+ # conn.put_copy_data ['more', 'data', 'to', 'copy']
175
+ # end
176
+ #
169
177
  # Example with CSV output format:
170
178
  # conn.copy_data "COPY my_table TO STDOUT CSV" do
171
179
  # while row=conn.get_copy_data
@@ -187,6 +195,18 @@ class PG::Connection
187
195
  # This receives all rows of +my_table+ as ruby array:
188
196
  # ["some", "data", "to", "copy"]
189
197
  # ["more", "data", "to", "copy"]
198
+ #
199
+ # Also PG::BinaryDecoder::CopyRow can be used to retrieve data in binary format from the server.
200
+ # In this case the header and trailer data is processed by the decoder and the remaining +nil+ from get_copy_data is processed by copy_data, so that binary data can be processed equally to text data:
201
+ # deco = PG::BinaryDecoder::CopyRow.new
202
+ # conn.copy_data "COPY my_table TO STDOUT (FORMAT binary)", deco do
203
+ # while row=conn.get_copy_data
204
+ # p row
205
+ # end
206
+ # end
207
+ # This receives all rows of +my_table+ as ruby array:
208
+ # ["some", "data", "to", "copy"]
209
+ # ["more", "data", "to", "copy"]
190
210
 
191
211
  def copy_data( sql, coder=nil )
192
212
  raise PG::NotInBlockingMode.new("copy_data can not be used in nonblocking mode", connection: self) if nonblocking?
@@ -195,7 +215,7 @@ class PG::Connection
195
215
  case res.result_status
196
216
  when PGRES_COPY_IN
197
217
  begin
198
- if res.binary_tuples == 1
218
+ if coder && res.binary_tuples == 1
199
219
  # Binary file header (11 byte signature, 32 bit flags and 32 bit extension length)
200
220
  put_copy_data(BinarySignature + ("\x00" * 8))
201
221
  end
@@ -219,7 +239,7 @@ class PG::Connection
219
239
  begin
220
240
  self.encoder_for_put_copy_data = old_coder if coder
221
241
 
222
- if res.binary_tuples == 1
242
+ if coder && res.binary_tuples == 1
223
243
  put_copy_data("\xFF\xFF") # Binary file trailer 16 bit "-1"
224
244
  end
225
245
 
@@ -244,8 +264,9 @@ class PG::Connection
244
264
  discard_results
245
265
  raise
246
266
  else
247
- if res.binary_tuples == 1
248
- # there are two end markers in binary mode: file trailer and the final nil
267
+ if coder && res.binary_tuples == 1
268
+ # There are two end markers in binary mode: file trailer and the final nil.
269
+ # The file trailer is expected to be processed by BinaryDecoder::CopyRow and already returns nil, so that the remaining NULL from PQgetCopyData is retrieved here:
249
270
  if get_copy_data
250
271
  discard_results
251
272
  raise PG::NotAllCopyDataRetrieved.new("Not all binary COPY data retrieved", connection: self)
@@ -7,19 +7,19 @@ module PG
7
7
  class TimestampUtc < Timestamp
8
8
  def initialize(hash={}, **kwargs)
9
9
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
10
- super(flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_UTC, **hash, **kwargs)
10
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_UTC)
11
11
  end
12
12
  end
13
13
  class TimestampUtcToLocal < Timestamp
14
14
  def initialize(hash={}, **kwargs)
15
15
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
16
- super(flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_LOCAL, **hash, **kwargs)
16
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_UTC | PG::Coder::TIMESTAMP_APP_LOCAL)
17
17
  end
18
18
  end
19
19
  class TimestampLocal < Timestamp
20
20
  def initialize(hash={}, **kwargs)
21
21
  warn "PG::Coder.new(hash) is deprecated. Please use keyword arguments instead! Called from #{caller.first}" unless hash.empty?
22
- super(flags: PG::Coder::TIMESTAMP_DB_LOCAL | PG::Coder::TIMESTAMP_APP_LOCAL, **hash, **kwargs)
22
+ super(**hash, **kwargs, flags: PG::Coder::TIMESTAMP_DB_LOCAL | PG::Coder::TIMESTAMP_APP_LOCAL)
23
23
  end
24
24
  end
25
25
 
data/lib/pg/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module PG
2
2
  # Library version
3
- VERSION = '1.5.0'
3
+ VERSION = '1.5.2'
4
4
  end
Binary file
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.2
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Michael Granger
@@ -34,7 +34,7 @@ cert_chain:
34
34
  Dzx/gFSOrRoCt2mXNgrmcAfr386AfaMvCh7cXqdxZwmVo7ILZCYXck0pajvubsDd
35
35
  NUIIFkVXvd1odFyK9LF1RFAtxn/iAmpx
36
36
  -----END CERTIFICATE-----
37
- date: 2023-04-24 00:00:00.000000000 Z
37
+ date: 2023-04-26 00:00:00.000000000 Z
38
38
  dependencies: []
39
39
  description: Pg is the Ruby interface to the PostgreSQL RDBMS. It works with PostgreSQL
40
40
  9.3 and later.
metadata.gz.sig CHANGED
Binary file