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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/binary-gems.yml +15 -9
- data/.github/workflows/source-gem.yml +9 -8
- data/Gemfile +1 -1
- data/History.rdoc +10 -5
- data/Rakefile.cross +2 -1
- data/certs/ged.pem +12 -12
- data/ext/extconf.rb +1 -0
- data/ext/pg.c +24 -3
- data/ext/pg_connection.c +213 -288
- data/ext/pg_record_coder.c +1 -1
- data/lib/pg/basic_type_registry.rb +1 -1
- data/lib/pg/connection.rb +245 -29
- data/lib/pg/version.rb +1 -1
- data/lib/pg.rb +2 -2
- data.tar.gz.sig +0 -0
- metadata +30 -24
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 651abffa980cbaef37ccb16afb4a6f107bf35d0314c2838b27d09ae88848dda7
|
4
|
+
data.tar.gz: 6910361844ff87e9885d21cd62e5f43522296c08396d8eb6bb8487ba452f2946
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 413b2ac42d264829d2985a9818ba79be9e67cbd3a5a8b4cbe42007dbca27e53917d6360ae4d03285470c21295d9f651e9d478bbe06491c43d6b015338c6b0d0d
|
7
|
+
data.tar.gz: 45ce1ad11dcb614018a6da4fa0b3d1f45b0be267922f7d803fc46bed9150aee6443ccacfdd6d70de1718fa8a6db1919de5498e9b544d8f194e8301d386e0ee07
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -1,4 +1,4 @@
|
|
1
|
-
name:
|
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.
|
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
|
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.
|
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
|
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
|
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:
|
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.
|
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.
|
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.
|
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:
|
58
|
-
PGVER: "
|
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
data/History.rdoc
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
== v1.3.0 [
|
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.
|
7
|
-
- Add
|
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
|
49
|
-
Fall back to rb_wait_for_single_fd() on ruby < 3.0
|
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+
|
3
|
-
|
4
|
-
|
2
|
+
MIID+DCCAmCgAwIBAgIBBDANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdnZWQv
|
3
|
+
REM9RmFlcmllTVVEL0RDPW9yZzAeFw0yMjAxMDcyMzU4MTRaFw0yMzAxMDcyMzU4
|
4
|
+
MTRaMCIxIDAeBgNVBAMMF2dlZC9EQz1GYWVyaWVNVUQvREM9b3JnMIIBojANBgkq
|
5
5
|
hkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAvyVhkRzvlEs0fe7145BYLfN6njX9ih5H
|
6
6
|
L60U0p0euIurpv84op9CNKF9tx+1WKwyQvQP7qFGuZx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P+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
|
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
|
|