pg 1.3.0 → 1.4.0
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.appveyor.yml +1 -1
- data/.github/workflows/binary-gems.yml +3 -3
- data/.github/workflows/source-gem.yml +5 -6
- data/History.rdoc +98 -1
- data/Rakefile.cross +4 -2
- data/certs/larskanis-2022.pem +26 -0
- data/ext/errorcodes.rb +0 -0
- data/ext/extconf.rb +13 -10
- data/ext/pg.h +1 -0
- data/ext/pg_connection.c +228 -212
- data/ext/pg_record_coder.c +6 -4
- data/ext/pg_result.c +16 -9
- data/ext/pg_tuple.c +2 -8
- data/ext/pg_type_map_all_strings.c +1 -0
- data/ext/pg_type_map_by_column.c +2 -0
- data/lib/pg/basic_type_registry.rb +8 -3
- data/lib/pg/connection.rb +178 -120
- data/lib/pg/exceptions.rb +7 -1
- data/lib/pg/version.rb +1 -1
- data/lib/pg.rb +9 -7
- data/misc/openssl-pg-segfault.rb +0 -0
- data/rakelib/task_extension.rb +46 -0
- data/sample/array_insert.rb +0 -0
- data/sample/async_api.rb +3 -7
- data/sample/async_copyto.rb +0 -0
- data/sample/async_mixed.rb +0 -0
- data/sample/check_conn.rb +0 -0
- data/sample/copydata.rb +0 -0
- data/sample/copyfrom.rb +0 -0
- data/sample/copyto.rb +0 -0
- data/sample/cursor.rb +0 -0
- data/sample/disk_usage_report.rb +0 -0
- data/sample/issue-119.rb +0 -0
- data/sample/losample.rb +0 -0
- data/sample/minimal-testcase.rb +0 -0
- data/sample/notify_wait.rb +0 -0
- data/sample/pg_statistics.rb +0 -0
- data/sample/replication_monitor.rb +0 -0
- data/sample/test_binary_values.rb +0 -0
- data/sample/wal_shipper.rb +0 -0
- data/sample/warehouse_partitions.rb +0 -0
- data.tar.gz.sig +0 -0
- metadata +32 -28
- metadata.gz.sig +0 -0
data/misc/openssl-pg-segfault.rb
CHANGED
|
File without changes
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# This source code is borrowed from:
|
|
2
|
+
# https://github.com/oneclick/rubyinstaller2/blob/b3dcbf69f131e44c78ea3a1c5e0041c223f266ce/lib/ruby_installer/build/utils.rb#L104-L144
|
|
3
|
+
|
|
4
|
+
module TaskExtension
|
|
5
|
+
# Extend rake's file task to be defined only once and to check the expected file is indeed generated
|
|
6
|
+
#
|
|
7
|
+
# The same as #task, but for #file.
|
|
8
|
+
# In addition this file task raises an error, if the file that is expected to be generated is not present after the block was executed.
|
|
9
|
+
def file(name, *args, &block)
|
|
10
|
+
task_once(name, block) do
|
|
11
|
+
super(name, *args) do |ta|
|
|
12
|
+
block.call(ta).tap do
|
|
13
|
+
raise "file #{ta.name} is missing after task executed" unless File.exist?(ta.name)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Extend rake's task definition to be defined only once, even if called several times
|
|
20
|
+
#
|
|
21
|
+
# This allows to define common tasks next to specific tasks.
|
|
22
|
+
# It is expected that any variation of the task's block is reflected in the task name or namespace.
|
|
23
|
+
# If the task name is identical, the task block is executed only once, even if the file task definition is executed twice.
|
|
24
|
+
def task(name, *args, &block)
|
|
25
|
+
task_once(name, block) do
|
|
26
|
+
super
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
private def task_once(name, block)
|
|
31
|
+
name = name.keys.first if name.is_a?(Hash)
|
|
32
|
+
if block &&
|
|
33
|
+
Rake::Task.task_defined?(name) &&
|
|
34
|
+
Rake::Task[name].instance_variable_get('@task_block_location') == block.source_location
|
|
35
|
+
# task is already defined for this target and the same block
|
|
36
|
+
# So skip double definition of the same action
|
|
37
|
+
Rake::Task[name]
|
|
38
|
+
elsif block
|
|
39
|
+
yield.tap do
|
|
40
|
+
Rake::Task[name].instance_variable_set('@task_block_location', block.source_location)
|
|
41
|
+
end
|
|
42
|
+
else
|
|
43
|
+
yield
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
data/sample/array_insert.rb
CHANGED
|
File without changes
|
data/sample/async_api.rb
CHANGED
|
@@ -27,10 +27,6 @@ conn = PG::Connection.connect_start( :dbname => 'test' ) or
|
|
|
27
27
|
abort "Connection failed: %s" % [ conn.error_message ] if
|
|
28
28
|
conn.status == PG::CONNECTION_BAD
|
|
29
29
|
|
|
30
|
-
# Now grab a reference to the underlying socket so we know when the
|
|
31
|
-
# connection is established
|
|
32
|
-
socket = conn.socket_io
|
|
33
|
-
|
|
34
30
|
# Track the progress of the connection, waiting for the socket to become readable/writable
|
|
35
31
|
# before polling it
|
|
36
32
|
poll_status = PG::PGRES_POLLING_WRITING
|
|
@@ -41,13 +37,13 @@ until poll_status == PG::PGRES_POLLING_OK ||
|
|
|
41
37
|
case poll_status
|
|
42
38
|
when PG::PGRES_POLLING_READING
|
|
43
39
|
output_progress " waiting for socket to become readable"
|
|
44
|
-
select( [
|
|
40
|
+
select( [conn.socket_io], nil, nil, TIMEOUT ) or
|
|
45
41
|
raise "Asynchronous connection timed out!"
|
|
46
42
|
|
|
47
43
|
# ...and the same for when the socket needs to write
|
|
48
44
|
when PG::PGRES_POLLING_WRITING
|
|
49
45
|
output_progress " waiting for socket to become writable"
|
|
50
|
-
select( nil, [
|
|
46
|
+
select( nil, [conn.socket_io], nil, TIMEOUT ) or
|
|
51
47
|
raise "Asynchronous connection timed out!"
|
|
52
48
|
end
|
|
53
49
|
|
|
@@ -85,7 +81,7 @@ loop do
|
|
|
85
81
|
# Buffer any incoming data on the socket until a full result is ready.
|
|
86
82
|
conn.consume_input
|
|
87
83
|
while conn.is_busy
|
|
88
|
-
select( [
|
|
84
|
+
select( [conn.socket_io], nil, nil, TIMEOUT ) or
|
|
89
85
|
raise "Timeout waiting for query response."
|
|
90
86
|
conn.consume_input
|
|
91
87
|
end
|
data/sample/async_copyto.rb
CHANGED
|
File without changes
|
data/sample/async_mixed.rb
CHANGED
|
File without changes
|
data/sample/check_conn.rb
CHANGED
|
File without changes
|
data/sample/copydata.rb
CHANGED
|
File without changes
|
data/sample/copyfrom.rb
CHANGED
|
File without changes
|
data/sample/copyto.rb
CHANGED
|
File without changes
|
data/sample/cursor.rb
CHANGED
|
File without changes
|
data/sample/disk_usage_report.rb
CHANGED
|
File without changes
|
data/sample/issue-119.rb
CHANGED
|
File without changes
|
data/sample/losample.rb
CHANGED
|
File without changes
|
data/sample/minimal-testcase.rb
CHANGED
|
File without changes
|
data/sample/notify_wait.rb
CHANGED
|
File without changes
|
data/sample/pg_statistics.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/sample/wal_shipper.rb
CHANGED
|
File without changes
|
|
File without changes
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,40 +1,42 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pg
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Granger
|
|
8
8
|
- Lars Kanis
|
|
9
|
-
autorequire:
|
|
9
|
+
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain:
|
|
12
12
|
- |
|
|
13
13
|
-----BEGIN CERTIFICATE-----
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
14
|
+
MIIETTCCArWgAwIBAgIBATANBgkqhkiG9w0BAQsFADAoMSYwJAYDVQQDDB1sYXJz
|
|
15
|
+
L0RDPWdyZWl6LXJlaW5zZG9yZi9EQz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90lnJzMgOs4KKgZYxqSQVSab
|
|
30
|
+
SCEmzIO/StkXY4NpJ4fYLrHemf/fJy1wPyu+fNdp5SEEUwEo+2toRFlzTe4u4LdS
|
|
31
|
+
QC636nPPTMt8H3xz2wf/lUIUeo2Qc95Qt2BQM465ibbG9kmA3c7Sopx6yOabYOAl
|
|
32
|
+
KPRbOSEPiWYcF9Suuz8Gdf8jxEtPlnZiwRvnYJ+IHMq3XQCJWPpMzdDMbtlgHbXE
|
|
33
|
+
vq1zOTLMSYAS0UB3uionR4yo1hLz60odwkCm7qf0o2Ci/5OjtB0a89VuyqRU2vUJ
|
|
34
|
+
QH95WBjDJ6lCCW7J0mrMPnJQSUFTmufsU6jOChvPaCeAzW1YwrsP/YKnvwueG7ip
|
|
35
|
+
VOdW6RitjtFxhS7evRL0201+KUvLz12zZWWjOcujlQs64QprxOtiv/MiisKb1Ng+
|
|
36
|
+
oL1mUdzB8KrZL4/WbG5YNX6UTtJbIOu9qEFbBAy4/jtIkJX+dlNoFwd4GXQW1YNO
|
|
37
|
+
nA==
|
|
36
38
|
-----END CERTIFICATE-----
|
|
37
|
-
date: 2022-
|
|
39
|
+
date: 2022-06-20 00:00:00.000000000 Z
|
|
38
40
|
dependencies: []
|
|
39
41
|
description: Pg is the Ruby interface to the PostgreSQL RDBMS. It works with PostgreSQL
|
|
40
42
|
9.3 and later.
|
|
@@ -72,6 +74,7 @@ files:
|
|
|
72
74
|
- Rakefile
|
|
73
75
|
- Rakefile.cross
|
|
74
76
|
- certs/ged.pem
|
|
77
|
+
- certs/larskanis-2022.pem
|
|
75
78
|
- ext/errorcodes.def
|
|
76
79
|
- ext/errorcodes.rb
|
|
77
80
|
- ext/errorcodes.txt
|
|
@@ -131,6 +134,7 @@ files:
|
|
|
131
134
|
- misc/ruby-pg/Rakefile
|
|
132
135
|
- misc/ruby-pg/lib/ruby/pg.rb
|
|
133
136
|
- pg.gemspec
|
|
137
|
+
- rakelib/task_extension.rb
|
|
134
138
|
- sample/array_insert.rb
|
|
135
139
|
- sample/async_api.rb
|
|
136
140
|
- sample/async_copyto.rb
|
|
@@ -158,7 +162,7 @@ metadata:
|
|
|
158
162
|
source_code_uri: https://github.com/ged/ruby-pg
|
|
159
163
|
changelog_uri: https://github.com/ged/ruby-pg/blob/master/History.rdoc
|
|
160
164
|
documentation_uri: http://deveiate.org/code/pg
|
|
161
|
-
post_install_message:
|
|
165
|
+
post_install_message:
|
|
162
166
|
rdoc_options:
|
|
163
167
|
- "--main"
|
|
164
168
|
- README.rdoc
|
|
@@ -175,8 +179,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
175
179
|
- !ruby/object:Gem::Version
|
|
176
180
|
version: '0'
|
|
177
181
|
requirements: []
|
|
178
|
-
rubygems_version: 3.
|
|
179
|
-
signing_key:
|
|
182
|
+
rubygems_version: 3.3.7
|
|
183
|
+
signing_key:
|
|
180
184
|
specification_version: 4
|
|
181
185
|
summary: Pg is the Ruby interface to the PostgreSQL RDBMS
|
|
182
186
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|