pg 1.3.0.rc1 → 1.3.0

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: f1c4c3d870d35392f82d086ca1594b52ace0cb7d336fc485ae1bd4bf6cfa6dfe
4
- data.tar.gz: '0028b8afa95d864a910a3856c5913f2243aab6e98803e2db669da6a50a34b135'
3
+ metadata.gz: 651abffa980cbaef37ccb16afb4a6f107bf35d0314c2838b27d09ae88848dda7
4
+ data.tar.gz: 6910361844ff87e9885d21cd62e5f43522296c08396d8eb6bb8487ba452f2946
5
5
  SHA512:
6
- metadata.gz: 9e96f15dad51337390e413799683c424f396251feba507f129dbc2f28371f8ae4e8242de3727c7899ddbc0db10ca574011a1b3fbed50bf3ddf138073d15b6030
7
- data.tar.gz: a88bd6ed081456c75fdb6d20b50dc9259bf64086091eb1ceee0fd633ba3a437c6d982f46d8031dec3a62213a76387cf8334d482340f559b4caa68534b7fe3507
6
+ metadata.gz: 413b2ac42d264829d2985a9818ba79be9e67cbd3a5a8b4cbe42007dbca27e53917d6360ae4d03285470c21295d9f651e9d478bbe06491c43d6b015338c6b0d0d
7
+ data.tar.gz: 45ce1ad11dcb614018a6da4fa0b3d1f45b0be267922f7d803fc46bed9150aee6443ccacfdd6d70de1718fa8a6db1919de5498e9b544d8f194e8301d386e0ee07
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,4 +1,4 @@
1
- name: Build and test binary gems
1
+ name: Binary gems
2
2
 
3
3
  on: [push, pull_request]
4
4
 
@@ -6,12 +6,18 @@ jobs:
6
6
  job_build_x64:
7
7
  name: build
8
8
  runs-on: ubuntu-latest
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ include:
13
+ - platform: "x64-mingw-ucrt"
14
+ - platform: "x64-mingw32"
9
15
  steps:
10
16
  - uses: actions/checkout@v2
11
17
  - name: Set up Ruby
12
18
  uses: ruby/setup-ruby@v1
13
19
  with:
14
- ruby-version: "3.0"
20
+ ruby-version: "3.1"
15
21
  - run: bundle install
16
22
 
17
23
  - name: Create a dummy cert to satisfy the build
@@ -22,7 +28,7 @@ jobs:
22
28
  cp gem-public_cert.pem ~/.gem/gem-public_cert.pem
23
29
 
24
30
  - name: Build binary gem
25
- run: bundle exec rake gem:windows:x64-mingw32
31
+ run: bundle exec rake gem:windows:${{ matrix.platform }}
26
32
 
27
33
  - name: Upload binary gem
28
34
  uses: actions/upload-artifact@v2
@@ -37,21 +43,20 @@ jobs:
37
43
  fail-fast: false
38
44
  matrix:
39
45
  include:
40
- - ruby: "3.0"
46
+ - ruby: "3.1"
47
+ platform: "x64-mingw-ucrt"
41
48
  PGVERSION: 14.0-1-windows-x64
42
- PGVER: "14"
43
49
  - ruby: "2.5"
50
+ platform: "x64-mingw32"
44
51
  PGVERSION: 10.16-1-windows
45
- PGVER: "10"
46
52
 
47
53
  runs-on: windows-latest
48
54
  env:
49
55
  PGVERSION: ${{ matrix.PGVERSION }}
50
- PGVER: ${{ matrix.PGVER }}
51
56
  steps:
52
57
  - uses: actions/checkout@v2
53
58
  - name: Set up Ruby
54
- uses: ruby/setup-ruby@v1
59
+ uses: MSP-Greg/ruby-setup-ruby@win-ucrt-1
55
60
  with:
56
61
  ruby-version: ${{ matrix.ruby }}
57
62
 
@@ -74,7 +79,8 @@ jobs:
74
79
  echo "PGUSER=$env:USERNAME" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
75
80
  echo "PGPASSWORD=" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
76
81
 
82
+ - run: gem update --system
77
83
  - run: bundle install
78
- - run: gem install --local *.gem --verbose
84
+ - run: gem install --local pg-*${{ matrix.platform }}.gem --verbose
79
85
  - name: Run specs
80
86
  run: ruby -rpg -S rspec spec/**/*_spec.rb
@@ -1,4 +1,4 @@
1
- name: Build and test source gem
1
+ name: Source gem
2
2
 
3
3
  on: [push, pull_request]
4
4
 
@@ -11,7 +11,7 @@ jobs:
11
11
  - name: Set up Ruby
12
12
  uses: ruby/setup-ruby@v1
13
13
  with:
14
- ruby-version: "3.0"
14
+ ruby-version: "3.1"
15
15
 
16
16
  - name: Build source gem
17
17
  run: gem build pg.gemspec
@@ -31,7 +31,7 @@ jobs:
31
31
  include:
32
32
  - os: windows
33
33
  ruby: "head"
34
- PGVERSION: 14.0-1-windows-x64
34
+ PGVERSION: 14.1-1-windows-x64
35
35
  PGVER: "14"
36
36
  - os: windows
37
37
  ruby: "2.5"
@@ -41,7 +41,7 @@ jobs:
41
41
  ruby: "head"
42
42
  PGVER: "14"
43
43
  - os: ubuntu
44
- ruby: "3.0"
44
+ ruby: "3.1"
45
45
  PGVER: "12"
46
46
  - os: ubuntu
47
47
  ruby: "2.5"
@@ -54,8 +54,8 @@ jobs:
54
54
  PGVER: "14"
55
55
  - os: macos
56
56
  ruby: "head"
57
- PGVERSION: 13.2-1-osx
58
- PGVER: "13"
57
+ PGVERSION: 14.1-1-osx
58
+ PGVER: "14"
59
59
 
60
60
  runs-on: ${{ matrix.os }}-latest
61
61
  env:
@@ -65,7 +65,7 @@ jobs:
65
65
  steps:
66
66
  - uses: actions/checkout@v2
67
67
  - name: Set up Ruby
68
- uses: MSP-Greg/ruby-setup-ruby@win-ucrt
68
+ uses: MSP-Greg/ruby-setup-ruby@win-ucrt-1
69
69
  with:
70
70
  ruby-version: ${{ matrix.ruby }}
71
71
 
@@ -110,12 +110,13 @@ jobs:
110
110
  unzip postgresql-$PGVERSION-binaries.zip && \
111
111
  echo `pwd`/pgsql/bin >> $GITHUB_PATH
112
112
 
113
+ - run: gem update --system
113
114
  - run: bundle install
114
115
 
115
116
  - run: gem install --local *.gem --verbose
116
117
 
117
118
  - name: Run specs
118
- continue-on-error: ${{ matrix.ruby == 'truffleruby' }}
119
+ continue-on-error: ${{ matrix.ruby == 'truffleruby-head' }}
119
120
  env:
120
121
  PG_DEBUG: 0
121
122
  run: ruby -rpg -S rspec spec/**/*_spec.rb -cfdoc
data/Gemfile CHANGED
@@ -9,6 +9,6 @@ group :development, :test do
9
9
  gem "bundler", ">= 1.16", "< 3.0"
10
10
  gem "rake-compiler", "~> 1.0"
11
11
  gem "rake-compiler-dock", "~> 1.0"
12
- gem "rdoc", "~> 5.1"
12
+ gem "rdoc", "~> 6.4"
13
13
  gem "rspec", "~> 3.5"
14
14
  end
data/History.rdoc CHANGED
@@ -1,10 +1,10 @@
1
- == v1.3.0 [YYY-MM-DD] Michael Granger <ged@FaerieMUD.org>
1
+ == v1.3.0 [2022-01-20] Michael Granger <ged@FaerieMUD.org>
2
2
 
3
3
  Install Enhancements:
4
4
  - Print some install help if libpq wasn't found. #396
5
5
  This should help to pick the necessary package without googling.
6
- - Update Windows fat binary gem to OpenSSL-1.1.1l and PostgreSQL-14.0.
7
- - Add a binary gem for Ruby 3.0.
6
+ - Update Windows fat binary gem to OpenSSL-1.1.1m and PostgreSQL-14.1.
7
+ - Add binary Windows gems for Ruby 3.0 and 3.1.
8
8
  - Make the library path of libpq available in ruby as PG::POSTGRESQL_LIB_PATH and add it to the search paths on Windows similar to +rpath+ on Unix systems. #373
9
9
  - Fall back to pkg-config if pg_config is not found. #380
10
10
  - Add option to extconf.rb to disable nogvl-wrapping of libpq functions.
@@ -27,6 +27,8 @@ API Enhancements:
27
27
  - Make discard_results scheduler friendly
28
28
  - Do all socket waiting through the conn.socket_io object.
29
29
  - Avoid PG.connect blocking while address resolution by automatically providing the +hostaddr+ parameter.
30
+ - On Windows Fiber.scheduler support requires Ruby-3.1+.
31
+ It is also only partly usable since may ruby IO methods are not yet scheduler aware on Windows.
30
32
  - Add support for pipeline mode of PostgreSQL-14. #401
31
33
  - Allow specification of multiple hosts in PostgreSQL URI. #387
32
34
  - Add new method conn.backend_key - used to implement our own cancel method.
@@ -43,16 +45,19 @@ Other Enhancements:
43
45
  - Support ObjectSpace.memsize_of(obj) on all classes implemented in C. #393
44
46
  - Make all PG objects implemented in C memory moveable and therefore GC.compact friendly. #349
45
47
  - Update errorcodes and error classes to PostgreSQL-14.0.
48
+ - Add PG::CONNECTION_* constants for conn.status of newer PostgreSQL versions.
46
49
  - Add better support for logical replication. #339
47
50
  - Change conn.socket_io to read+write mode and to a BasicSocket object instead of IO.
48
- - Use rb_io_wait() and the conn.socket_io object if available and remove Windows specific wait functions.
49
- Fall back to rb_wait_for_single_fd() on ruby < 3.0, which works on Windows as well.
51
+ - Use rb_io_wait() and the conn.socket_io object if available for better compatibility to Fiber.scheduler .
52
+ Fall back to rb_wait_for_single_fd() on ruby < 3.0.
53
+ - On Windows use a specialized wait function as a workaround for very poor performance of rb_io_wait(). #416
50
54
 
51
55
  Bugfixes:
52
56
  - Release GVL while calling PQping which is a blocking method, but it didn't release GVL so far.
53
57
  - Fix Connection#transaction to no longer block on interrupts, for instance when pressing Ctrl-C and cancel a running query. #390
54
58
  - Avoid casting of OIDs to fix compat with Redshift database. #369
55
59
  - Call conn.block before each conn.get_result call to avoid possible blocking in case of a slow network and multiple query results.
60
+ - Sporadic Errno::ENOTSOCK when using conn.socket_io on Windows #398
56
61
 
57
62
  Deprecated:
58
63
  - Add deprecation warning to PG::BasicTypeRegistry.register_type and siblings.
data/Rakefile.cross CHANGED
@@ -250,6 +250,7 @@ class CrossLibrary < OpenStruct
250
250
  end
251
251
 
252
252
  CrossLibraries = [
253
+ ['x64-mingw-ucrt', 'mingw64', 'x86_64-w64-mingw32'],
253
254
  ['x86-mingw32', 'mingw', 'i686-w64-mingw32'],
254
255
  ['x64-mingw32', 'mingw64', 'x86_64-w64-mingw32'],
255
256
  ].map do |platform, openssl_config, toolchain|
@@ -291,7 +292,7 @@ CrossLibraries.each do |xlib|
291
292
  RakeCompilerDock.sh <<-EOT, platform: platform
292
293
  (cp build/gem/gem-*.pem ~/.gem/ || true) &&
293
294
  bundle install --local &&
294
- rake native:#{platform} pkg/#{$gem_spec.full_name}-#{platform}.gem MAKE="make -j`nproc`" RUBY_CC_VERSION=3.0.0:2.7.0:2.6.0:2.5.0
295
+ rake native:#{platform} pkg/#{$gem_spec.full_name}-#{platform}.gem MAKE="make -j`nproc`" RUBY_CC_VERSION=3.1.0:3.0.0:2.7.0:2.6.0:2.5.0
295
296
  EOT
296
297
  end
297
298
  desc "Build the windows binary gems"
data/certs/ged.pem CHANGED
@@ -1,7 +1,7 @@
1
1
  -----BEGIN CERTIFICATE-----
2
- MIID+DCCAmCgAwIBAgIBAzANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdnZWQv
3
- REM9RmFlcmllTVVEL0RDPW9yZzAeFw0yMDEyMjQyMDU1MjlaFw0yMTEyMjQyMDU1
4
- MjlaMCIxIDAeBgNVBAMMF2dlZC9EQz1GYWVyaWVNVUQvREM9b3JnMIIBojANBgkq
2
+ MIID+DCCAmCgAwIBAgIBBDANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdnZWQv
3
+ REM9RmFlcmllTVVEL0RDPW9yZzAeFw0yMjAxMDcyMzU4MTRaFw0yMzAxMDcyMzU4
4
+ MTRaMCIxIDAeBgNVBAMMF2dlZC9EQz1GYWVyaWVNVUQvREM9b3JnMIIBojANBgkq
5
5
  hkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAvyVhkRzvlEs0fe7145BYLfN6njX9ih5H
6
6
  L60U0p0euIurpv84op9CNKF9tx+1WKwyQvQP7qFGuZxkSUuWcP/sFhDXL1lWUuIl
7
7
  M4uHbGCRmOshDrF4dgnBeOvkHr1fIhPlJm5FO+Vew8tSQmlDsosxLUx+VB7DrVFO
@@ -12,13 +12,13 @@ dXzdHqq+zbGZVSQ7pRYHYomD0IiDe1DbIouFnPWmagaBnGHwXkDT2bKKP+s2v21m
12
12
  ozilJg4aar2okb/RA6VS87o+d7g6LpDDMMQjH4G9OPnJENLdhu8KnPw/ivSVvQw7
13
13
  N2I4L/ZOIe2DIVuYH7aLHfjZDQv/mNgpAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYD
14
14
  VR0PBAQDAgSwMB0GA1UdDgQWBBRyjf55EbrHagiRLqt5YAd3yb8k4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AbNW+gvd3QHRiWTTuhgHrdDnGdXg93N2M5KHn1ug8BtPLQwlcFwEpKnlLn
23
+ btEP+7EplFuoiMfd
24
24
  -----END CERTIFICATE-----
data/ext/extconf.rb CHANGED
@@ -155,6 +155,7 @@ have_func 'rb_io_wait' # since ruby-3.0
155
155
  # unistd.h confilicts with ruby/win32.h when cross compiling for win32 and ruby 1.9.1
156
156
  have_header 'unistd.h'
157
157
  have_header 'inttypes.h'
158
+ have_header('ruby/fiber/scheduler.h') if RUBY_PLATFORM=~/mingw|mswin/
158
159
 
159
160
  checking_for "C99 variable length arrays" do
160
161
  $defs.push( "-DHAVE_VARIABLE_LENGTH_ARRAYS" ) if try_compile('void test_vla(int l){ int vla[l]; }')
data/ext/pg.c CHANGED
@@ -47,6 +47,7 @@
47
47
  */
48
48
 
49
49
  #include "pg.h"
50
+ #include "pg_config.h"
50
51
 
51
52
  int pg_skip_deprecation_warning;
52
53
  VALUE rb_mPG;
@@ -415,14 +416,34 @@ Init_pg_ext()
415
416
  rb_define_const(rb_mPGconstants, "CONNECTION_MADE", INT2FIX(CONNECTION_MADE));
416
417
  /* Waiting for a response from the server. */
417
418
  rb_define_const(rb_mPGconstants, "CONNECTION_AWAITING_RESPONSE", INT2FIX(CONNECTION_AWAITING_RESPONSE));
418
- /* Received authentication; waiting for backend start-up to finish. */
419
+ /* Received authentication; waiting for backend startup. */
419
420
  rb_define_const(rb_mPGconstants, "CONNECTION_AUTH_OK", INT2FIX(CONNECTION_AUTH_OK));
421
+ /* This state is no longer used. */
422
+ rb_define_const(rb_mPGconstants, "CONNECTION_SETENV", INT2FIX(CONNECTION_SETENV));
420
423
  /* Negotiating SSL encryption. */
421
424
  rb_define_const(rb_mPGconstants, "CONNECTION_SSL_STARTUP", INT2FIX(CONNECTION_SSL_STARTUP));
422
- /* Negotiating environment-driven parameter settings. */
423
- rb_define_const(rb_mPGconstants, "CONNECTION_SETENV", INT2FIX(CONNECTION_SETENV));
424
425
  /* Internal state - PG.connect() needed. */
425
426
  rb_define_const(rb_mPGconstants, "CONNECTION_NEEDED", INT2FIX(CONNECTION_NEEDED));
427
+ #if PG_MAJORVERSION_NUM >= 10
428
+ /* Checking if session is read-write. Available since PostgreSQL-10. */
429
+ rb_define_const(rb_mPGconstants, "CONNECTION_CHECK_WRITABLE", INT2FIX(CONNECTION_CHECK_WRITABLE));
430
+ #endif
431
+ #if PG_MAJORVERSION_NUM >= 10
432
+ /* Consuming any extra messages. Available since PostgreSQL-10. */
433
+ rb_define_const(rb_mPGconstants, "CONNECTION_CONSUME", INT2FIX(CONNECTION_CONSUME));
434
+ #endif
435
+ #if PG_MAJORVERSION_NUM >= 12
436
+ /* Negotiating GSSAPI. Available since PostgreSQL-12. */
437
+ rb_define_const(rb_mPGconstants, "CONNECTION_GSS_STARTUP", INT2FIX(CONNECTION_GSS_STARTUP));
438
+ #endif
439
+ #if PG_MAJORVERSION_NUM >= 13
440
+ /* Checking target server properties. Available since PostgreSQL-13. */
441
+ rb_define_const(rb_mPGconstants, "CONNECTION_CHECK_TARGET", INT2FIX(CONNECTION_CHECK_TARGET));
442
+ #endif
443
+ #if PG_MAJORVERSION_NUM >= 14
444
+ /* Checking if server is in standby mode. Available since PostgreSQL-14. */
445
+ rb_define_const(rb_mPGconstants, "CONNECTION_CHECK_STANDBY", INT2FIX(CONNECTION_CHECK_STANDBY));
446
+ #endif
426
447
 
427
448
  /****** PG::Connection CLASS CONSTANTS: Nonblocking connection polling status ******/
428
449