pg 1.5.7-x86-mingw32 → 1.5.8-x86-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcffcfbe65d0345c333943e4a3b75ab332c59c9574bbb534f9ae996638f17e47
4
- data.tar.gz: ba81052dee707148246891d92f5f5e5cfc4df93c88c3dc295dc0d6634c9838c4
3
+ metadata.gz: a7b4903d6035f8e6a5560c5e0e796649cce3a97ac71f26aecf1f1c67fe789f54
4
+ data.tar.gz: bc8bc3d30fce84ec6ad8ef908e77d7e7011c934aaabed49b989fc96931c22832
5
5
  SHA512:
6
- metadata.gz: 61ff1cee0768545a7a1074c1079c0db9d0ef7d0e3f7ab36c5c96a35bfb2ceda1efcd18413ad1bb78e5cb6f54534705c38efc7e744f72ddd7bc1fc8c47a2d2cb1
7
- data.tar.gz: d38e94350d23a8d89fd22b4d01774edd790ff4cd3a1431e0a3d0ef7b77829940f748f0f379680a88751b858ec4a92299942cdc74cb00aa83a1f8891285b47fc2
6
+ metadata.gz: 3a38d2002642997aaac11a7714a1b6fa6653288fec64ba99d699074dfbf2578516567101724366d14c046f7f2948b322e5e81e31ec13a1d9c2153e17d4e30d00
7
+ data.tar.gz: f6e5c192fd32cb00005845fa69a6b75425068b6c3ac7629bf0b14ed42adfe5a5259b594847a6a2c1dd2fefc5922f07f672aa061049ee642a6128d6d974132a97
checksums.yaml.gz.sig CHANGED
Binary file
@@ -19,7 +19,7 @@ jobs:
19
19
  - platform: "x64-mingw32"
20
20
  - platform: "x86-mingw32"
21
21
  steps:
22
- - uses: actions/checkout@v3
22
+ - uses: actions/checkout@v4
23
23
  - name: Set up Ruby
24
24
  uses: ruby/setup-ruby@v1
25
25
  with:
@@ -37,9 +37,9 @@ jobs:
37
37
  run: bundle exec rake gem:windows:${{ matrix.platform }}
38
38
 
39
39
  - name: Upload binary gem
40
- uses: actions/upload-artifact@v3
40
+ uses: actions/upload-artifact@v4
41
41
  with:
42
- name: binary-gem
42
+ name: binary-gem-${{ matrix.platform }}
43
43
  path: pkg/*.gem
44
44
 
45
45
  job_test_binary:
@@ -66,7 +66,7 @@ jobs:
66
66
  env:
67
67
  PGVERSION: ${{ matrix.PGVERSION }}
68
68
  steps:
69
- - uses: actions/checkout@v3
69
+ - uses: actions/checkout@v4
70
70
  - name: Set up Ruby
71
71
  if: matrix.platform != 'x86-mingw32'
72
72
  uses: ruby/setup-ruby@v1
@@ -85,9 +85,9 @@ jobs:
85
85
  echo "C:/msys64/$env:MSYSTEM_PREFIX/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
86
86
 
87
87
  - name: Download gem from build job
88
- uses: actions/download-artifact@v3
88
+ uses: actions/download-artifact@v4
89
89
  with:
90
- name: binary-gem
90
+ name: binary-gem-${{ matrix.platform }}
91
91
 
92
92
  - name: Download PostgreSQL
93
93
  run: |
@@ -1,18 +1,26 @@
1
1
  name: Source gem
2
-
3
2
  on:
4
- push:
5
- pull_request:
6
3
  workflow_dispatch:
7
4
  schedule:
8
5
  - cron: "0 5 * * 3" # At 05:00 on Wednesday # https://crontab.guru/#0_5_*_*_3
6
+ push:
7
+ branches:
8
+ - master
9
+ tags:
10
+ - "*.*.*"
11
+ pull_request:
12
+ types: [opened, synchronize]
13
+ branches:
14
+ - "*"
15
+ permissions:
16
+ contents: read
9
17
 
10
18
  jobs:
11
19
  job_build_gem:
12
20
  name: Build
13
21
  runs-on: ubuntu-latest
14
22
  steps:
15
- - uses: actions/checkout@v3
23
+ - uses: actions/checkout@v4
16
24
  - name: Set up Ruby
17
25
  uses: ruby/setup-ruby@v1
18
26
  with:
@@ -22,7 +30,7 @@ jobs:
22
30
  run: gem build pg.gemspec
23
31
 
24
32
  - name: Upload source gem
25
- uses: actions/upload-artifact@v3
33
+ uses: actions/upload-artifact@v4
26
34
  with:
27
35
  name: source-gem
28
36
  path: "*.gem"
@@ -74,14 +82,14 @@ jobs:
74
82
  MAKE: make -j2 V=1
75
83
 
76
84
  steps:
77
- - uses: actions/checkout@v3
85
+ - uses: actions/checkout@v4
78
86
  - name: Set up Ruby
79
87
  uses: ruby/setup-ruby@v1
80
88
  with:
81
89
  ruby-version: ${{ matrix.ruby }}
82
90
 
83
91
  - name: Download gem from build job
84
- uses: actions/download-artifact@v3
92
+ uses: actions/download-artifact@v4
85
93
  with:
86
94
  name: source-gem
87
95
 
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## v1.5.8 [2024-09-06] Lars Kanis <lars@greiz-reinsdorf.de>
2
+
3
+ - Fix host list duplication every time conn.reset is used. [#586](https://github.com/ged/ruby-pg/pull/586)
4
+ - Add default decoder for anonymous record types to BasicTypeRegistry [#579](https://github.com/ged/ruby-pg/pull/579)
5
+ - Update Windows fat binary gem to OpenSSL-3.3.2 and PostgreSQL-16.4.
6
+
7
+
1
8
  ## v1.5.7 [2024-07-28] Lars Kanis <lars@greiz-reinsdorf.de>
2
9
 
3
10
  - Remove deprecated use of fptr->fd.[#562](https://github.com/ged/ruby-pg/pull/562)
@@ -8,6 +15,7 @@
8
15
  - Add missing PG::RollbackTransaction as an option to exit conn.transaction. [#560](https://github.com/ged/ruby-pg/pull/560)
9
16
  Usage like in rails: https://api.rubyonrails.org/classes/ActiveRecord/Rollback.html
10
17
  - Don't print a warning when bigdecimal is required on ruby-3.4+ [#574](https://github.com/ged/ruby-pg/pull/574)
18
+ - Update Windows fat binary gem to OpenSSL-3.3.1 and PostgreSQL-16.3.
11
19
 
12
20
 
13
21
  ## v1.5.6 [2024-03-01] Lars Kanis <lars@greiz-reinsdorf.de>
data/Rakefile.cross CHANGED
@@ -31,8 +31,8 @@ class CrossLibrary < OpenStruct
31
31
  self.host_platform = toolchain
32
32
 
33
33
  # Cross-compilation constants
34
- self.openssl_version = ENV['OPENSSL_VERSION'] || '3.3.1'
35
- self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '16.3'
34
+ self.openssl_version = ENV['OPENSSL_VERSION'] || '3.3.2'
35
+ self.postgresql_version = ENV['POSTGRESQL_VERSION'] || '16.4'
36
36
 
37
37
  # Check if symlinks work in the current working directory.
38
38
  # This fails, if rake-compiler-dock is running on a Windows box.
@@ -52,9 +52,8 @@ class CrossLibrary < OpenStruct
52
52
 
53
53
  # Static OpenSSL build vars
54
54
  self.static_openssl_builddir = static_builddir + "openssl-#{openssl_version}"
55
-
56
55
  self.openssl_source_uri =
57
- URI( "http://www.openssl.org/source/openssl-#{openssl_version}.tar.gz" )
56
+ URI( "https://github.com/openssl/openssl/releases/download/openssl-#{openssl_version}/openssl-#{openssl_version}.tar.gz" )
58
57
  self.openssl_tarball = static_sourcesdir + File.basename( openssl_source_uri.path )
59
58
  self.openssl_makefile = static_openssl_builddir + 'Makefile'
60
59
 
@@ -233,6 +233,8 @@ j2date(int jd, int *year, int *month, int *day)
233
233
  *
234
234
  * This is a decoder class for conversion of PostgreSQL binary date
235
235
  * to Ruby Date objects.
236
+ *
237
+ * As soon as this class is used, it requires the ruby standard library 'date'.
236
238
  */
237
239
  static VALUE
238
240
  pg_bin_dec_date(t_pg_coder *conv, const char *val, int len, int tuple, int field, int enc_idx)
data/ext/pg_connection.c CHANGED
@@ -264,6 +264,7 @@ pgconn_s_allocate( VALUE klass )
264
264
  RB_OBJ_WRITE(self, &this->decoder_for_get_copy_data, Qnil);
265
265
  RB_OBJ_WRITE(self, &this->trace_stream, Qnil);
266
266
  rb_ivar_set(self, rb_intern("@calls_to_put_copy_data"), INT2FIX(0));
267
+ rb_ivar_set(self, rb_intern("@iopts_for_reset"), Qnil);
267
268
 
268
269
  return self;
269
270
  }
@@ -3135,7 +3136,9 @@ pgconn_async_get_last_result(VALUE self)
3135
3136
  for(;;) {
3136
3137
  int status;
3137
3138
 
3138
- /* wait for input (without blocking) before reading each result */
3139
+ /* Wait for input before reading each result.
3140
+ * That way we support the ruby-3.x IO scheduler and don't block other ruby threads.
3141
+ */
3139
3142
  wait_socket_readable(self, NULL, get_result_readable);
3140
3143
 
3141
3144
  cur = gvl_PQgetResult(conn);
data/ext/pg_copy_coder.c CHANGED
@@ -212,6 +212,7 @@ pg_copycoder_type_map_get(VALUE self)
212
212
  *
213
213
  * See also PG::TextDecoder::CopyRow for the decoding direction with
214
214
  * PG::Connection#get_copy_data .
215
+ * And see PG::BinaryEncoder::CopyRow for an encoder of the COPY binary format.
215
216
  */
216
217
  static int
217
218
  pg_text_enc_copy_row(t_pg_coder *conv, VALUE value, char *out, VALUE *intermediate, int enc_idx)
@@ -358,6 +359,7 @@ pg_text_enc_copy_row(t_pg_coder *conv, VALUE value, char *out, VALUE *intermedia
358
359
  *
359
360
  * See also PG::BinaryDecoder::CopyRow for the decoding direction with
360
361
  * PG::Connection#get_copy_data .
362
+ * And see PG::TextEncoder::CopyRow for an encoder of the COPY text format.
361
363
  */
362
364
  static int
363
365
  pg_bin_enc_copy_row(t_pg_coder *conv, VALUE value, char *out, VALUE *intermediate, int enc_idx)
@@ -496,6 +498,7 @@ GetDecimalFromHex(char hex)
496
498
  *
497
499
  * See also PG::TextEncoder::CopyRow for the encoding direction with
498
500
  * PG::Connection#put_copy_data .
501
+ * And see PG::BinaryDecoder::CopyRow for a decoder of the COPY binary format.
499
502
  */
500
503
  /*
501
504
  * Parse the current line into separate attributes (fields),
@@ -763,6 +766,7 @@ static const char BinarySignature[11] = "PGCOPY\n\377\r\n\0";
763
766
  *
764
767
  * See also PG::BinaryEncoder::CopyRow for the encoding direction with
765
768
  * PG::Connection#put_copy_data .
769
+ * And see PG::TextDecoder::CopyRow for a decoder of the COPY text format.
766
770
  */
767
771
  static VALUE
768
772
  pg_bin_dec_copy_row(t_pg_coder *conv, const char *input_line, int len, int _tuple, int _field, int enc_idx)
@@ -340,7 +340,7 @@ record_isspace(char ch)
340
340
  * conn.exec("SELECT * FROM my_table").map_types!(PG::TypeMapByColumn.new([deco]*2)).to_a
341
341
  * # => [{"v1"=>[2.0, 3.0], "v2"=>[4.0, 5.0]}, {"v1"=>[6.0, 7.0], "v2"=>[8.0, 9.0]}]
342
342
  *
343
- * It's more very convenient to use the PG::BasicTypeRegistry, which is based on database OIDs.
343
+ * It's more convenient to use the PG::BasicTypeRegistry, which is based on database OIDs.
344
344
  * # Fetch a NULL record of our type to retrieve the OIDs of the two fields "r" and "i"
345
345
  * oids = conn.exec( "SELECT (NULL::complex).*" )
346
346
  * # Build a type map (PG::TypeMapByColumn) for decoding the "complex" type
@@ -163,6 +163,8 @@ pg_text_dec_integer(t_pg_coder *conv, const char *val, int len, int tuple, int f
163
163
  * This is a decoder class for conversion of PostgreSQL numeric types
164
164
  * to Ruby BigDecimal objects.
165
165
  *
166
+ * As soon as this class is used, it requires the 'bigdecimal' gem.
167
+ *
166
168
  */
167
169
  static VALUE
168
170
  pg_text_dec_numeric(t_pg_coder *conv, const char *val, int len, int tuple, int field, int enc_idx)
@@ -811,6 +813,7 @@ static VALUE pg_text_dec_timestamp(t_pg_coder *conv, const char *val, int len, i
811
813
  * This is a decoder class for conversion of PostgreSQL inet type
812
814
  * to Ruby IPAddr values.
813
815
  *
816
+ * As soon as this class is used, it requires the ruby standard library 'ipaddr'.
814
817
  */
815
818
  static VALUE
816
819
  pg_text_dec_inet(t_pg_coder *conv, const char *val, int len, int tuple, int field, int enc_idx)
@@ -119,6 +119,10 @@ pg_text_enc_boolean(t_pg_coder *this, VALUE value, char *out, VALUE *intermediat
119
119
  int
120
120
  pg_coder_enc_to_s(t_pg_coder *this, VALUE value, char *out, VALUE *intermediate, int enc_idx)
121
121
  {
122
+ /* Attention:
123
+ * In contrast to all other encoders, the "this" pointer of this encoder can be NULL.
124
+ * This is because it is used as a fall-back if no encoder is defined.
125
+ */
122
126
  VALUE str = rb_obj_as_string(value);
123
127
  if( ENCODING_GET(str) == enc_idx ){
124
128
  *intermediate = str;
@@ -345,6 +349,8 @@ pg_text_enc_float(t_pg_coder *conv, VALUE value, char *out, VALUE *intermediate,
345
349
  *
346
350
  * It converts Integer, Float and BigDecimal objects.
347
351
  * All other objects are expected to respond to +to_s+.
352
+ *
353
+ * As soon as this class is used, it requires the 'bigdecimal' gem.
348
354
  */
349
355
  static int
350
356
  pg_text_enc_numeric(t_pg_coder *this, VALUE value, char *out, VALUE *intermediate, int enc_idx)
data/lib/2.5/pg_ext.so CHANGED
Binary file
data/lib/2.6/pg_ext.so CHANGED
Binary file
data/lib/2.7/pg_ext.so CHANGED
Binary file
data/lib/3.0/pg_ext.so CHANGED
Binary file
data/lib/3.1/pg_ext.so CHANGED
Binary file
data/lib/3.2/pg_ext.so CHANGED
Binary file
data/lib/3.3/pg_ext.so CHANGED
Binary file
@@ -278,6 +278,7 @@ class PG::BasicTypeRegistry
278
278
  register_type 0, 'inet', PG::TextEncoder::Inet, PG::TextDecoder::Inet
279
279
  alias_type 0, 'cidr', 'inet'
280
280
 
281
+ register_type 0, 'record', PG::TextEncoder::Record, PG::TextDecoder::Record
281
282
 
282
283
 
283
284
  register_type 1, 'int2', PG::BinaryEncoder::Int2, PG::BinaryDecoder::Integer
data/lib/pg/connection.rb CHANGED
@@ -573,7 +573,9 @@ class PG::Connection
573
573
  # Resets the backend connection. This method closes the
574
574
  # backend connection and tries to re-connect.
575
575
  def reset
576
- iopts = conninfo_hash.compact
576
+ # Use connection options from PG::Connection.new to reconnect with the same options but with renewed DNS resolution.
577
+ # Use conninfo_hash as a fallback when connect_start was used to create the connection object.
578
+ iopts = @iopts_for_reset || conninfo_hash.compact
577
579
  if iopts[:host] && !iopts[:host].empty? && PG.library_version >= 100000
578
580
  iopts = self.class.send(:resolve_hosts, iopts)
579
581
  end
@@ -825,6 +827,7 @@ class PG::Connection
825
827
  iopts = PG::Connection.conninfo_parse(option_string).each_with_object({}){|h, o| o[h[:keyword].to_sym] = h[:val] if h[:val] }
826
828
  iopts = PG::Connection.conndefaults.each_with_object({}){|h, o| o[h[:keyword].to_sym] = h[:val] if h[:val] }.merge(iopts)
827
829
 
830
+ iopts_for_reset = iopts
828
831
  if iopts[:hostaddr]
829
832
  # hostaddr is provided -> no need to resolve hostnames
830
833
 
@@ -838,6 +841,8 @@ class PG::Connection
838
841
 
839
842
  raise PG::ConnectionBad, conn.error_message if conn.status == PG::CONNECTION_BAD
840
843
 
844
+ # save the connection options for conn.reset
845
+ conn.instance_variable_set(:@iopts_for_reset, iopts_for_reset)
841
846
  conn.send(:async_connect_or_reset, :connect_poll)
842
847
  conn
843
848
  end
@@ -5,6 +5,9 @@ require 'date'
5
5
 
6
6
  module PG
7
7
  module TextDecoder
8
+ # This is a decoder class for conversion of PostgreSQL date type to Ruby Date values.
9
+ #
10
+ # As soon as this class is used, it requires the ruby standard library 'date'.
8
11
  class Date < SimpleDecoder
9
12
  def decode(string, tuple=nil, field=nil)
10
13
  if string =~ /\A(\d{4})-(\d\d)-(\d\d)\z/
@@ -5,6 +5,9 @@ require 'json'
5
5
 
6
6
  module PG
7
7
  module TextDecoder
8
+ # This is a decoder class for conversion of PostgreSQL JSON/JSONB type to Ruby Hash, Array, String, Numeric, nil values.
9
+ #
10
+ # As soon as this class is used, it requires the ruby standard library 'json'.
8
11
  class JSON < SimpleDecoder
9
12
  def decode(string, tuple=nil, field=nil)
10
13
  ::JSON.parse(string, quirks_mode: true)
@@ -3,6 +3,7 @@
3
3
 
4
4
  module PG
5
5
  module TextEncoder
6
+ # This is a encoder class for conversion of Ruby Date values to PostgreSQL date type.
6
7
  class Date < SimpleEncoder
7
8
  def encode(value)
8
9
  value.respond_to?(:strftime) ? value.strftime("%Y-%m-%d") : value
@@ -5,6 +5,9 @@ require 'ipaddr'
5
5
 
6
6
  module PG
7
7
  module TextEncoder
8
+ # This is a encoder class for conversion of Ruby IPAddr values to PostgreSQL inet type.
9
+ #
10
+ # As soon as this class is used, it requires the ruby standard library 'ipaddr'.
8
11
  class Inet < SimpleEncoder
9
12
  def encode(value)
10
13
  case value
@@ -5,6 +5,9 @@ require 'json'
5
5
 
6
6
  module PG
7
7
  module TextEncoder
8
+ # This is a encoder class for conversion of Ruby Hash, Array, String, Numeric, nil values to PostgreSQL JSON/JSONB type.
9
+ #
10
+ # As soon as this class is used, it requires the ruby standard library 'json'.
8
11
  class JSON < SimpleEncoder
9
12
  def encode(value)
10
13
  ::JSON.generate(value, quirks_mode: true)
data/lib/pg/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module PG
2
2
  # Library version
3
- VERSION = '1.5.7'
3
+ VERSION = '1.5.8'
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.7
4
+ version: 1.5.8
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Michael Granger
@@ -34,7 +34,7 @@ cert_chain:
34
34
  5wFER6XhvvLDFAMh/jMg+s7Wd5SbSHgHNSUaUGVtdWkVPOer6oF0aLdZUR3CETkn
35
35
  5nWXZma/BUd3YgYA/Xumc6QQqIS4p7mr
36
36
  -----END CERTIFICATE-----
37
- date: 2024-07-28 00:00:00.000000000 Z
37
+ date: 2024-09-06 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