pg 1.6.0.rc1-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +4 -0
  3. data/BSDL +22 -0
  4. data/Contributors.rdoc +46 -0
  5. data/Gemfile +23 -0
  6. data/History.md +958 -0
  7. data/LICENSE +56 -0
  8. data/Manifest.txt +72 -0
  9. data/POSTGRES +23 -0
  10. data/README-OS_X.rdoc +68 -0
  11. data/README-Windows.rdoc +56 -0
  12. data/README.ja.md +300 -0
  13. data/README.md +286 -0
  14. data/Rakefile +161 -0
  15. data/certs/ged.pem +24 -0
  16. data/certs/kanis@comcard.de.pem +20 -0
  17. data/certs/larskanis-2022.pem +26 -0
  18. data/certs/larskanis-2023.pem +24 -0
  19. data/certs/larskanis-2024.pem +24 -0
  20. data/ext/errorcodes.def +1043 -0
  21. data/ext/errorcodes.rb +45 -0
  22. data/ext/errorcodes.txt +494 -0
  23. data/ext/extconf.rb +282 -0
  24. data/ext/gvl_wrappers.c +32 -0
  25. data/ext/gvl_wrappers.h +297 -0
  26. data/ext/pg.c +703 -0
  27. data/ext/pg.h +390 -0
  28. data/ext/pg_binary_decoder.c +460 -0
  29. data/ext/pg_binary_encoder.c +583 -0
  30. data/ext/pg_cancel_connection.c +360 -0
  31. data/ext/pg_coder.c +622 -0
  32. data/ext/pg_connection.c +4869 -0
  33. data/ext/pg_copy_coder.c +921 -0
  34. data/ext/pg_errors.c +95 -0
  35. data/ext/pg_record_coder.c +522 -0
  36. data/ext/pg_result.c +1764 -0
  37. data/ext/pg_text_decoder.c +1008 -0
  38. data/ext/pg_text_encoder.c +833 -0
  39. data/ext/pg_tuple.c +572 -0
  40. data/ext/pg_type_map.c +200 -0
  41. data/ext/pg_type_map_all_strings.c +130 -0
  42. data/ext/pg_type_map_by_class.c +271 -0
  43. data/ext/pg_type_map_by_column.c +355 -0
  44. data/ext/pg_type_map_by_mri_type.c +313 -0
  45. data/ext/pg_type_map_by_oid.c +388 -0
  46. data/ext/pg_type_map_in_ruby.c +333 -0
  47. data/ext/pg_util.c +149 -0
  48. data/ext/pg_util.h +65 -0
  49. data/ext/vc/pg.sln +26 -0
  50. data/ext/vc/pg_18/pg.vcproj +216 -0
  51. data/ext/vc/pg_19/pg_19.vcproj +209 -0
  52. data/lib/2.7/pg_ext.so +0 -0
  53. data/lib/3.0/pg_ext.so +0 -0
  54. data/lib/3.1/pg_ext.so +0 -0
  55. data/lib/3.2/pg_ext.so +0 -0
  56. data/lib/3.3/pg_ext.so +0 -0
  57. data/lib/pg/basic_type_map_based_on_result.rb +67 -0
  58. data/lib/pg/basic_type_map_for_queries.rb +202 -0
  59. data/lib/pg/basic_type_map_for_results.rb +104 -0
  60. data/lib/pg/basic_type_registry.rb +311 -0
  61. data/lib/pg/binary_decoder/date.rb +9 -0
  62. data/lib/pg/binary_decoder/timestamp.rb +26 -0
  63. data/lib/pg/binary_encoder/timestamp.rb +20 -0
  64. data/lib/pg/cancel_connection.rb +30 -0
  65. data/lib/pg/coder.rb +106 -0
  66. data/lib/pg/connection.rb +1027 -0
  67. data/lib/pg/exceptions.rb +31 -0
  68. data/lib/pg/result.rb +43 -0
  69. data/lib/pg/text_decoder/date.rb +21 -0
  70. data/lib/pg/text_decoder/inet.rb +9 -0
  71. data/lib/pg/text_decoder/json.rb +17 -0
  72. data/lib/pg/text_decoder/numeric.rb +9 -0
  73. data/lib/pg/text_decoder/timestamp.rb +30 -0
  74. data/lib/pg/text_encoder/date.rb +13 -0
  75. data/lib/pg/text_encoder/inet.rb +31 -0
  76. data/lib/pg/text_encoder/json.rb +17 -0
  77. data/lib/pg/text_encoder/numeric.rb +9 -0
  78. data/lib/pg/text_encoder/timestamp.rb +24 -0
  79. data/lib/pg/tuple.rb +30 -0
  80. data/lib/pg/type_map_by_column.rb +16 -0
  81. data/lib/pg/version.rb +4 -0
  82. data/lib/pg.rb +144 -0
  83. data/misc/openssl-pg-segfault.rb +31 -0
  84. data/misc/postgres/History.txt +9 -0
  85. data/misc/postgres/Manifest.txt +5 -0
  86. data/misc/postgres/README.txt +21 -0
  87. data/misc/postgres/Rakefile +21 -0
  88. data/misc/postgres/lib/postgres.rb +16 -0
  89. data/misc/ruby-pg/History.txt +9 -0
  90. data/misc/ruby-pg/Manifest.txt +5 -0
  91. data/misc/ruby-pg/README.txt +21 -0
  92. data/misc/ruby-pg/Rakefile +21 -0
  93. data/misc/ruby-pg/lib/ruby/pg.rb +16 -0
  94. data/pg.gemspec +36 -0
  95. data/ports/x86_64-linux/lib/libpq-ruby-pg.so.1 +0 -0
  96. data/rakelib/task_extension.rb +46 -0
  97. data/sample/array_insert.rb +20 -0
  98. data/sample/async_api.rb +102 -0
  99. data/sample/async_copyto.rb +39 -0
  100. data/sample/async_mixed.rb +56 -0
  101. data/sample/check_conn.rb +21 -0
  102. data/sample/copydata.rb +71 -0
  103. data/sample/copyfrom.rb +81 -0
  104. data/sample/copyto.rb +19 -0
  105. data/sample/cursor.rb +21 -0
  106. data/sample/disk_usage_report.rb +177 -0
  107. data/sample/issue-119.rb +94 -0
  108. data/sample/losample.rb +69 -0
  109. data/sample/minimal-testcase.rb +17 -0
  110. data/sample/notify_wait.rb +72 -0
  111. data/sample/pg_statistics.rb +285 -0
  112. data/sample/replication_monitor.rb +222 -0
  113. data/sample/test_binary_values.rb +33 -0
  114. data/sample/wal_shipper.rb +434 -0
  115. data/sample/warehouse_partitions.rb +311 -0
  116. data.tar.gz.sig +0 -0
  117. metadata +252 -0
  118. metadata.gz.sig +0 -0
data/History.md ADDED
@@ -0,0 +1,958 @@
1
+ ## v1.6.0.rc1 [2024-11-28] Lars Kanis <lars@greiz-reinsdorf.de>
2
+
3
+ Added:
4
+
5
+ - Add fat binary gem for platform `x86_64-linux`.
6
+ [#551](https://github.com/ged/ruby-pg/pull/551#issuecomment-2504715762)
7
+ - Add PG::BinaryDecoder::Array and PG::BinaryEncoder::Array to parse and encode PostgreSQL arrays in binary format.
8
+ [#603](https://github.com/ged/ruby-pg/pull/603)
9
+ - Add support for new query cancel functions of PostgreSQL-17.
10
+ This adds the new class `PG::CancelConnection` which provides the ability to cancel a query per blocking or per non-blocking functions.
11
+ If the new functions are available they are used and the older are no longer compiled in.
12
+ This way we can get rid of reading out the internal `PGcancel` struct by `Connection#backend_key`.
13
+ [#614](https://github.com/ged/ruby-pg/pull/614)
14
+ - Add Connection#set_chunked_rows_mode [#610](https://github.com/ged/ruby-pg/pull/610)
15
+ - Add PG::Connection#close_prepared, PG::Connection#close_portal, PG::Connection#send_close_prepared and PG::Connection#send_close_portal which are new in PostgreSQL-17.
16
+ [#611](https://github.com/ged/ruby-pg/pull/611)
17
+ - Add Connection#send_pipeline_sync, async_pipeline_sync and release GVL at PQ(sendP|P)ipelineSync.
18
+ [#612](https://github.com/ged/ruby-pg/pull/612)
19
+
20
+ Removed:
21
+
22
+ - Drop support of Ruby < 2.7 [#606](https://github.com/ged/ruby-pg/pull/606)
23
+ - Drop support of PostgreSQL < 10 [#606](https://github.com/ged/ruby-pg/pull/606)
24
+ - Remove workaround for Truffleruby < 21.3.0 [#613](https://github.com/ged/ruby-pg/pull/613)
25
+
26
+
27
+ ## v1.5.9 [2024-10-24] Lars Kanis <lars@greiz-reinsdorf.de>
28
+
29
+ - Enable thread safety in static OpenSSL build for Windows. [#595](https://github.com/ged/ruby-pg/pull/595)
30
+ - Remove raising `conect_timeout` from 1 to 2 seconds. [#590](https://github.com/ged/ruby-pg/pull/590)
31
+ - Fix binary copy_data in Ractor context. [#594](https://github.com/ged/ruby-pg/pull/594)
32
+ - Exclude CI files and hidden files from built gem. [#591](https://github.com/ged/ruby-pg/pull/591)
33
+ This is to simplify security inspection.
34
+ - Update error classes to PostgreSQL-17.
35
+ - Update Windows fat binary gem to OpenSSL-3.4.0 and PostgreSQL-17.0.
36
+
37
+
38
+ ## v1.5.8 [2024-09-06] Lars Kanis <lars@greiz-reinsdorf.de>
39
+
40
+ - Fix host list duplication every time conn.reset is used. [#586](https://github.com/ged/ruby-pg/pull/586)
41
+ - Add default decoder for anonymous record types to BasicTypeRegistry [#579](https://github.com/ged/ruby-pg/pull/579)
42
+ - Update Windows fat binary gem to OpenSSL-3.3.2 and PostgreSQL-16.4.
43
+
44
+
45
+ ## v1.5.7 [2024-07-28] Lars Kanis <lars@greiz-reinsdorf.de>
46
+
47
+ - Remove deprecated use of fptr->fd.[#562](https://github.com/ged/ruby-pg/pull/562)
48
+ Direct access is disallowed since ruby-3.4.
49
+ - Make `pgconn_connect_poll` close the socket prior to calling `PQconnectPoll`. [#564](https://github.com/ged/ruby-pg/pull/564)
50
+ This could result in an exception while connecting when used multi threaded.
51
+ - Fix several typos and improve spelling in documentation and code. [#566](https://github.com/ged/ruby-pg/pull/566)
52
+ - Add missing PG::RollbackTransaction as an option to exit conn.transaction. [#560](https://github.com/ged/ruby-pg/pull/560)
53
+ Usage like in rails: https://api.rubyonrails.org/classes/ActiveRecord/Rollback.html
54
+ - Don't print a warning when bigdecimal is required on ruby-3.4+ [#574](https://github.com/ged/ruby-pg/pull/574)
55
+ - Update Windows fat binary gem to OpenSSL-3.3.1 and PostgreSQL-16.3.
56
+
57
+
58
+ ## v1.5.6 [2024-03-01] Lars Kanis <lars@greiz-reinsdorf.de>
59
+
60
+ - Renew address resolution (DNS) in conn.reset. [#558](https://github.com/ged/ruby-pg/pull/558)
61
+ This is important, if DNS is used for load balancing, etc.
62
+ - Make bigdecimal an optional dependency. [#556](https://github.com/ged/ruby-pg/pull/556)
63
+ It's a gem in ruby-3.4+, so that users shouldn't be forced to use it.
64
+
65
+
66
+ ## v1.5.5 [2024-02-15] Lars Kanis <lars@greiz-reinsdorf.de>
67
+
68
+ - Explicitly retype timespec fields to int64_t to fix compatibility with 32bit arches. [#547](https://github.com/ged/ruby-pg/pull/547)
69
+ - Fix possible buffer overflows in PG::BinaryDecoder::CopyRow on 32 bit systems. [#548](https://github.com/ged/ruby-pg/pull/548)
70
+ - Add binary Windows gems for Ruby 3.3.
71
+ - Update Windows fat binary gem to OpenSSL-3.2.1 and PostgreSQL-16.2.
72
+
73
+
74
+ ## v1.5.4 [2023-09-01] Lars Kanis <lars@greiz-reinsdorf.de>
75
+
76
+ - Fix compiling the pg extension with MSVC 2022. [#535](https://github.com/ged/ruby-pg/pull/535)
77
+ - Set PG::Connection's encoding even if setting client_encoding on connection startup fails. [#541](https://github.com/ged/ruby-pg/pull/541)
78
+ - Don't set the server's client_encoding if it's unnecessary. [#542](https://github.com/ged/ruby-pg/pull/542)
79
+ This is important for connection proxies, who disallow configuration settings.
80
+ - Update Windows fat binary gem to OpenSSL-3.1.2 and PostgreSQL-15.4.
81
+
82
+
83
+ ## v1.5.3 [2023-04-28] Lars Kanis <lars@greiz-reinsdorf.de>
84
+
85
+ - Fix possible segfault when creating a new PG::Result with type map. [#530](https://github.com/ged/ruby-pg/pull/530)
86
+ - Add category to deprecation warnings of Coder.new, so that they are suppressed for most users. [#528](https://github.com/ged/ruby-pg/pull/528)
87
+
88
+
89
+ ## v1.5.2 [2023-04-26] Lars Kanis <lars@greiz-reinsdorf.de>
90
+
91
+ - Fix regression in copy_data regarding binary format when using no coder. [#527](https://github.com/ged/ruby-pg/pull/527)
92
+
93
+
94
+ ## v1.5.1 [2023-04-24] Lars Kanis <lars@greiz-reinsdorf.de>
95
+
96
+ - Don't overwrite flags of timestamp coders. [#524](https://github.com/ged/ruby-pg/pull/524)
97
+ Fixes a regression in rails: https://github.com/rails/rails/issues/48049
98
+
99
+
100
+ ## v1.5.0 [2023-04-24] Lars Kanis <lars@greiz-reinsdorf.de>
101
+
102
+ Enhancements:
103
+
104
+ - Better support for binary format:
105
+ - Extend PG::Connection#copy_data to better support binary transfers [#511](https://github.com/ged/ruby-pg/pull/511)
106
+ - Add binary COPY encoder and decoder:
107
+ * PG::BinaryEncoder::CopyRow
108
+ * PG::BinaryDecoder::CopyRow
109
+ - Add binary timestamp encoders:
110
+ * PG::BinaryEncoder::TimestampUtc
111
+ * PG::BinaryEncoder::TimestampLocal
112
+ * PG::BinaryEncoder::Timestamp
113
+ - Add PG::BinaryEncoder::Float4 and Float8
114
+ - Add binary date type: [#515](https://github.com/ged/ruby-pg/pull/515)
115
+ * PG::BinaryEncoder::Date
116
+ * PG::BinaryDecoder::Date
117
+ - Add PG::Result#binary_tuples [#511](https://github.com/ged/ruby-pg/pull/511)
118
+ It is useful for COPY and not deprecated in that context.
119
+ - Add PG::TextEncoder::Bytea to BasicTypeRegistry [#506](https://github.com/ged/ruby-pg/pull/506)
120
+ - Ractor support: [#519](https://github.com/ged/ruby-pg/pull/519)
121
+ - Pg is now fully compatible with Ractor introduced in Ruby-3.0 and doesn't use any global mutable state.
122
+ - All type en/decoders and type maps are shareable between ractors if they are made frozen by `Ractor.make_shareable`.
123
+ - Also frozen PG::Result and PG::Tuple objects can be shared.
124
+ - All frozen objects (except PG::Connection) can still be used to do communication with the PostgreSQL server or to read retrieved data.
125
+ - PG::Connection is not shareable and must be created within each Ractor to establish a dedicated connection.
126
+ - Use keyword arguments instead of hashes for Coder initialization and #to_h. [#511](https://github.com/ged/ruby-pg/pull/511)
127
+ - Add PG::Result.res_status as a class method and extend Result#res_status to return the status of self. [#508](https://github.com/ged/ruby-pg/pull/508)
128
+ - Reduce the number of files loaded at `require 'pg'` by using autoload. [#513](https://github.com/ged/ruby-pg/pull/513)
129
+ Previously stdlib libraries `date`, `json`, `ipaddr` and `bigdecimal` were static dependencies, but now only `socket` is mandatory.
130
+ - Improve garbage collector performance by adding write barriers to all PG classes. [#518](https://github.com/ged/ruby-pg/pull/518)
131
+ Now they can be promoted to the old generation, which means they only get marked on major GC.
132
+ - New method PG::Connection#check_socket to check the socket state. [#521](https://github.com/ged/ruby-pg/pull/521)
133
+ - Mark many internal constants as private. [#522](https://github.com/ged/ruby-pg/pull/522)
134
+ - Update Windows fat binary gem to OpenSSL-3.1.0.
135
+
136
+ Bugfixes:
137
+
138
+ - Move nfields-check of stream-methods after result status check [#507](https://github.com/ged/ruby-pg/pull/507)
139
+ This ensures that the nfield-check doesn't hide errors like statement timeout.
140
+
141
+ Removed:
142
+
143
+ - Remove deprecated PG::BasicTypeRegistry.register_type and co. [Part of #519](https://github.com/ged/ruby-pg/commit/2919ee1a0c6b216e18e1d06c95c2616ef69d2f97)
144
+ - Add deprecation warning about PG::Coder initialization per Hash argument. [#514](https://github.com/ged/ruby-pg/pull/514)
145
+ It is recommended to use keyword arguments instead.
146
+ - The internal encoding cache was removed. [#516](https://github.com/ged/ruby-pg/pull/516)
147
+ It shouldn't have a practical performance impact.
148
+
149
+ Repository:
150
+
151
+ - `rake test` tries to find PostgreSQL server commands by pg_config [#503](https://github.com/ged/ruby-pg/pull/503)
152
+ So there's no need to set the PATH manually any longer.
153
+
154
+
155
+ ## v1.4.6 [2023-02-26] Lars Kanis <lars@greiz-reinsdorf.de>
156
+
157
+ - Add japanese README file. [#502](https://github.com/ged/ruby-pg/pull/502)
158
+ - Improve `discard_results` to not block under memory pressure. [#500](https://github.com/ged/ruby-pg/pull/500)
159
+ - Use a dedicated error class `PG::LostCopyState` for errors due to another query within `copy_data` and mention that it's probably due to another query.
160
+ Previously the "no COPY in progress" `PG::Error` was less specific. [#499](https://github.com/ged/ruby-pg/pull/499)
161
+ - Make sure an error in `put_copy_end` of `copy_data` doesn't lose the original exception.
162
+ - Disable nonblocking mode while large object calls. [#498](https://github.com/ged/ruby-pg/pull/498)
163
+ Since pg-1.3.0 libpq's "lo_*" calls failed when a bigger amount of data was transferred.
164
+ This specifically forced the `active_storage-postgresql` gem to use pg-1.2.3.
165
+ - Add rdoc options to gemspec, so that "gem install" generates complete offline documentation.
166
+ - Add binary Windows gems for Ruby 3.2.
167
+ - Update Windows fat binary gem to PostgreSQL-15.2 and OpenSSL-3.0.8.
168
+
169
+
170
+ ## v1.4.5 [2022-11-17] Lars Kanis <lars@greiz-reinsdorf.de>
171
+
172
+ - Return the libpq default port when blank in conninfo. [#492](https://github.com/ged/ruby-pg/pull/492)
173
+ - Add PG::DEF_PGPORT constant and use it in specs. [#492](https://github.com/ged/ruby-pg/pull/492)
174
+ - Fix name resolution when empty or `nil` port is given.
175
+ - Update error codes to PostgreSQL-15.
176
+ - Update Windows fat binary gem to PostgreSQL-15.1 AND OpenSSL-1.1.1s.
177
+
178
+
179
+ ## v1.4.4 [2022-10-11] Lars Kanis <lars@greiz-reinsdorf.de>
180
+
181
+ - Revert to let libpq do the host iteration while connecting. [#485](https://github.com/ged/ruby-pg/pull/485)
182
+ Ensure that parameter `connect_timeout` is still respected.
183
+ - Handle multiple hosts in the connection string, where only one host has writable session. [#476](https://github.com/ged/ruby-pg/pull/476)
184
+ - Add some useful information to PG::Connection#inspect. [#487](https://github.com/ged/ruby-pg/pull/487)
185
+ - Support new pgresult_stream_any API in sequel_pg-1.17.0. [#481](https://github.com/ged/ruby-pg/pull/481)
186
+ - Update Windows fat binary gem to PostgreSQL-14.5.
187
+
188
+
189
+ ## v1.4.3 [2022-08-09] Lars Kanis <lars@greiz-reinsdorf.de>
190
+
191
+ - Avoid memory bloat possible in put_copy_data in pg-1.4.0 to 1.4.2. [#473](https://github.com/ged/ruby-pg/pull/473)
192
+ - Use Encoding::BINARY for JOHAB, removing some useless code. [#472](https://github.com/ged/ruby-pg/pull/472)
193
+
194
+
195
+ ## v1.4.2 [2022-07-27] Lars Kanis <lars@greiz-reinsdorf.de>
196
+
197
+ Bugfixes:
198
+
199
+ - Properly handle empty host parameter when connecting. [#471](https://github.com/ged/ruby-pg/pull/471)
200
+ - Update Windows fat binary gem to OpenSSL-1.1.1q.
201
+
202
+
203
+ ## v1.4.1 [2022-06-24] Lars Kanis <lars@greiz-reinsdorf.de>
204
+
205
+ Bugfixes:
206
+
207
+ - Fix another ruby-2.7 keyword warning. [#465](https://github.com/ged/ruby-pg/pull/465)
208
+ - Allow PG::Error to be created without arguments. [#466](https://github.com/ged/ruby-pg/pull/466)
209
+
210
+
211
+ ## v1.4.0 [2022-06-20] Lars Kanis <lars@greiz-reinsdorf.de>
212
+
213
+ Added:
214
+
215
+ - Add PG::Connection#hostaddr, present since PostgreSQL-12. [#453](https://github.com/ged/ruby-pg/pull/453)
216
+ - Add PG::Connection.conninfo_parse to wrap PQconninfoParse. [#453](https://github.com/ged/ruby-pg/pull/453)
217
+
218
+ Bugfixes:
219
+
220
+ - Try IPv6 and IPv4 addresses, if DNS resolves to both. [#452](https://github.com/ged/ruby-pg/pull/452)
221
+ - Re-add block-call semantics to PG::Connection.new accidentally removed in pg-1.3.0. [#454](https://github.com/ged/ruby-pg/pull/454)
222
+ - Handle client error after all data consumed in #copy_data for output. [#455](https://github.com/ged/ruby-pg/pull/455)
223
+ - Avoid spurious keyword argument warning on Ruby 2.7. [#456](https://github.com/ged/ruby-pg/pull/456)
224
+ - Change connection setup to respect connect_timeout parameter. [#459](https://github.com/ged/ruby-pg/pull/459)
225
+ - Fix indefinite hang in case of connection error on Windows [#458](https://github.com/ged/ruby-pg/pull/458)
226
+ - Set connection attribute of PG::Error in various places where it was missing. [#461](https://github.com/ged/ruby-pg/pull/461)
227
+ - Fix transaction leak on early break/return. [#463](https://github.com/ged/ruby-pg/pull/463)
228
+ - Update Windows fat binary gem to OpenSSL-1.1.1o and PostgreSQL-14.4.
229
+
230
+ Enhancements:
231
+
232
+ - Don't flush at each put_copy_data call, but flush at get_result. [#462](https://github.com/ged/ruby-pg/pull/462)
233
+
234
+
235
+ ## v1.3.5 [2022-03-31] Lars Kanis <lars@greiz-reinsdorf.de>
236
+
237
+ Bugfixes:
238
+
239
+ - Handle PGRES_COMMAND_OK in pgresult_stream_any. [#447](https://github.com/ged/ruby-pg/pull/447)
240
+ Fixes usage when trying to stream the result of a procedure call that returns no results.
241
+
242
+ Enhancements:
243
+
244
+ - Rename BasicTypeRegistry#define_default_types to #register_default_types to use a more consistent terminology.
245
+ Keeping define_default_types for compatibility.
246
+ - BasicTypeRegistry: return self instead of objects by accident.
247
+ This allows call chaining.
248
+ - Add some April fun. [#449](https://github.com/ged/ruby-pg/pull/449)
249
+
250
+ Documentation:
251
+ - Refine documentation of conn.socket_io and conn.connect_poll
252
+
253
+
254
+ ## v1.3.4 [2022-03-10] Lars Kanis <lars@greiz-reinsdorf.de>
255
+
256
+ Bugfixes:
257
+
258
+ - Don't leak IO in case of connection errors. [#439](https://github.com/ged/ruby-pg/pull/439)
259
+ Previously it was kept open until the PG::Connection was garbage collected.
260
+ - Fix a performance regression in conn.get_result noticed in single row mode. [#442](https://github.com/ged/ruby-pg/pull/442)
261
+ - Fix occasional error Errno::EBADF (Bad file descriptor) while connecting. [#444](https://github.com/ged/ruby-pg/pull/444)
262
+ - Fix compatibility of res.stream_each* methods with Fiber.scheduler. [#446](https://github.com/ged/ruby-pg/pull/446)
263
+ - Remove FL_TEST and FL_SET, which are MRI-internal. [#437](https://github.com/ged/ruby-pg/pull/437)
264
+
265
+ Enhancements:
266
+
267
+ - Allow pgresult_stream_any to be used by sequel_pg. [#443](https://github.com/ged/ruby-pg/pull/443)
268
+
269
+
270
+ ## v1.3.3 [2022-02-22] Lars Kanis <lars@greiz-reinsdorf.de>
271
+
272
+ Bugfixes:
273
+
274
+ - Fix omission of the third digit of IPv4 addresses in connection URI. [#435](https://github.com/ged/ruby-pg/pull/435)
275
+ - Fix wrong permission of certs/larskanis-2022.pem in the pg-1.3.2.gem. [#432](https://github.com/ged/ruby-pg/pull/432)
276
+
277
+
278
+ ## v1.3.2 [2022-02-14] Lars Kanis <lars@greiz-reinsdorf.de>
279
+
280
+ Bugfixes:
281
+
282
+ - Cancel only active query after failing transaction. [#430](https://github.com/ged/ruby-pg/pull/430)
283
+ This avoids an incompatibility with pgbouncer since pg-1.3.0.
284
+ - Fix String objects with non-applied encoding when using COPY or record decoders. [#427](https://github.com/ged/ruby-pg/pull/427)
285
+ - Update Windows fat binary gem to PostgreSQL-14.2.
286
+
287
+ Enhancements:
288
+
289
+ - Improve extconf.rb checks to reduces the number of compiler calls.
290
+ - Add a check for PGRES_PIPELINE_SYNC, to make sure the library version and the header files are PostgreSQL-14+. [#429](https://github.com/ged/ruby-pg/pull/429)
291
+
292
+
293
+ ## v1.3.1 [2022-02-01] Michael Granger <ged@FaerieMUD.org>
294
+
295
+ Bugfixes:
296
+
297
+ - Fix wrong handling of socket writability on Windows introduced in [#417](https://github.com/ged/ruby-pg/pull/417).
298
+ This caused starvation in conn.put_copy_data.
299
+ - Fix error in PG.version_string(true). [#419](https://github.com/ged/ruby-pg/pull/419)
300
+ - Fix a regression in pg 1.3.0 where Ruby 2.x busy-looping any fractional seconds for every wait. [#420](https://github.com/ged/ruby-pg/pull/420)
301
+
302
+ Enhancements:
303
+
304
+ - Raise an error when conn.copy_data is used in nonblocking mode.
305
+
306
+
307
+ ## v1.3.0 [2022-01-20] Michael Granger <ged@FaerieMUD.org>
308
+
309
+ Install Enhancements:
310
+ - Print some install help if libpq wasn't found. [#396](https://github.com/ged/ruby-pg/pull/396)
311
+ This should help to pick the necessary package without googling.
312
+ - Update Windows fat binary gem to OpenSSL-1.1.1m and PostgreSQL-14.1.
313
+ - Add binary Windows gems for Ruby 3.0 and 3.1.
314
+ - 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](https://github.com/ged/ruby-pg/pull/373)
315
+ - Fall back to pkg-config if pg_config is not found. [#380](https://github.com/ged/ruby-pg/pull/380)
316
+ - Add option to extconf.rb to disable nogvl-wrapping of libpq functions.
317
+ All methods (except PG::Connection.ping) are nonblocking now, so that GVL unlock is in theory no longer necessary.
318
+ However it can have some advantage in concurrency, so that GVL unlock is still enabled by default.
319
+ Use:
320
+ - gem inst pg -- --disable-gvl-unlock
321
+
322
+ API Enhancements:
323
+ - Add full compatibility to Fiber.scheduler introduced in Ruby-3.0. [#397](https://github.com/ged/ruby-pg/pull/397)
324
+ - Add async_connect and async_send methods and add specific specs for Fiber.scheduler [#342](https://github.com/ged/ruby-pg/pull/342)
325
+ - Add async_get_result and async_get_last_result
326
+ - Add async_get_copy_data
327
+ - Implement async_put_copy_data/async_put_copy_end
328
+ - Implement async_reset method using the nonblocking libpq API
329
+ - Add async_set_client_encoding which is compatible to scheduler
330
+ - Add async_cancel as a nonblocking version of conn#cancel
331
+ - Add async_encrypt_password
332
+ - Run Connection.ping in a second thread.
333
+ - Make discard_results scheduler friendly
334
+ - Do all socket waiting through the conn.socket_io object.
335
+ - Avoid PG.connect blocking while address resolution by automatically providing the +hostaddr+ parameter and resolving in Ruby instead of libpq.
336
+ - On Windows Fiber.scheduler support requires Ruby-3.1+.
337
+ It is also only partly usable since may ruby IO methods are not yet scheduler aware on Windows.
338
+ - Add support for pipeline mode of PostgreSQL-14. [#401](https://github.com/ged/ruby-pg/pull/401)
339
+ - Allow specification of multiple hosts in PostgreSQL URI. [#387](https://github.com/ged/ruby-pg/pull/387)
340
+ - Add new method conn.backend_key - used to implement our own cancel method.
341
+
342
+ Type cast enhancements:
343
+ - Add PG::BasicTypeMapForQueries::BinaryData for encoding of bytea columns. [#348](https://github.com/ged/ruby-pg/pull/348)
344
+ - Reduce time to build coder maps and permit to reuse them for several type maps per PG::BasicTypeRegistry::CoderMapsBundle.new(conn) . [#376](https://github.com/ged/ruby-pg/pull/376)
345
+ - Make BasicTypeRegistry a class and use a global default instance of it.
346
+ Now a local type registry can be instantiated and given to the type map, to avoid changing shared global states.
347
+ - Allow PG::BasicTypeMapForQueries to take a Proc as callback for undefined types.
348
+
349
+ Other Enhancements:
350
+ - Convert all PG classes implemented in C to TypedData objects. [#349](https://github.com/ged/ruby-pg/pull/349)
351
+ - Support ObjectSpace.memsize_of(obj) on all classes implemented in C. [#393](https://github.com/ged/ruby-pg/pull/393)
352
+ - Make all PG objects implemented in C memory moveable and therefore GC.compact friendly. [#349](https://github.com/ged/ruby-pg/pull/349)
353
+ - Update errorcodes and error classes to PostgreSQL-14.0.
354
+ - Add PG::CONNECTION_* constants for conn.status of newer PostgreSQL versions.
355
+ - Add better support for logical replication. [#339](https://github.com/ged/ruby-pg/pull/339)
356
+ - Change conn.socket_io to read+write mode and to a BasicSocket object instead of IO.
357
+ - Use rb_io_wait() and the conn.socket_io object if available for better compatibility to Fiber.scheduler .
358
+ Fall back to rb_wait_for_single_fd() on ruby < 3.0.
359
+ - On Windows use a specialized wait function as a workaround for very poor performance of rb_io_wait(). [#416](https://github.com/ged/ruby-pg/pull/416)
360
+
361
+ Bugfixes:
362
+ - Release GVL while calling PQping which is a blocking method, but it didn't release GVL so far.
363
+ - Fix Connection#transaction to no longer block on interrupts, for instance when pressing Ctrl-C and cancel a running query. [#390](https://github.com/ged/ruby-pg/pull/390)
364
+ - Avoid casting of OIDs to fix compat with Redshift database. [#369](https://github.com/ged/ruby-pg/pull/369)
365
+ - Call conn.block before each conn.get_result call to avoid possible blocking in case of a slow network and multiple query results.
366
+ - Sporadic Errno::ENOTSOCK when using conn.socket_io on Windows [#398](https://github.com/ged/ruby-pg/pull/398)
367
+
368
+ Deprecated:
369
+ - Add deprecation warning to PG::BasicTypeRegistry.register_type and siblings.
370
+
371
+ Removed:
372
+ - Remove support of ruby-2.2, 2.3 and 2.4. Minimum is ruby-2.5 now.
373
+ - Remove support for PostgreSQL-9.2. Minimum is PostgreSQL-9.3 now.
374
+ - Remove constant PG::REVISION, which was broken since pg-1.1.4.
375
+
376
+ Repository:
377
+ - Replace Hoe by Bundler for gem packaging
378
+ - Add Github Actions CI and testing of source and binary gems.
379
+
380
+
381
+ ## v1.2.3 [2020-03-18] Michael Granger <ged@FaerieMUD.org>
382
+
383
+ Bugfixes:
384
+
385
+ - Fix possible segfault at `PG::Coder#encode`, `decode` or their implicit calls through
386
+ a typemap after GC.compact. [#327](https://github.com/ged/ruby-pg/pull/327)
387
+ - Fix possible segfault in `PG::TypeMapByClass` after GC.compact. [#328](https://github.com/ged/ruby-pg/pull/328)
388
+
389
+
390
+ ## v1.2.2 [2020-01-06] Michael Granger <ged@FaerieMUD.org>
391
+
392
+ Enhancements:
393
+
394
+ - Add a binary gem for Ruby 2.7.
395
+
396
+
397
+ ## v1.2.1 [2020-01-02] Michael Granger <ged@FaerieMUD.org>
398
+
399
+ Enhancements:
400
+
401
+ - Added internal API for sequel_pg compatibility.
402
+
403
+
404
+ ## v1.2.0 [2019-12-20] Michael Granger <ged@FaerieMUD.org>
405
+
406
+ Repository:
407
+ - Our primary repository has been moved to Github https://github.com/ged/ruby-pg .
408
+ Most of the issues from https://bitbucket.org/ged/ruby-pg have been migrated. [#43](https://github.com/ged/ruby-pg/pull/43)
409
+
410
+ API enhancements:
411
+ - Add PG::Result#field_name_type= and siblings to allow symbols to be used as field names. [#306](https://github.com/ged/ruby-pg/pull/306)
412
+ - Add new methods for error reporting:
413
+ - PG::Connection#set_error_context_visibility
414
+ - PG::Result#verbose_error_message
415
+ - PG::Result#result_verbose_error_message (alias)
416
+ - Update errorcodes and error classes to PostgreSQL-12.0.
417
+ - New constants: PG_DIAG_SEVERITY_NONLOCALIZED, PQERRORS_SQLSTATE, PQSHOW_CONTEXT_NEVER, PQSHOW_CONTEXT_ERRORS, PQSHOW_CONTEXT_ALWAYS
418
+
419
+ Type cast enhancements:
420
+ - Add PG::TextEncoder::Record and PG::TextDecoder::Record for en/decoding of Composite Types. [#258](https://github.com/ged/ruby-pg/pull/258), [#36](https://github.com/ged/ruby-pg/pull/36)
421
+ - Add PG::BasicTypeRegistry.register_coder to register instances instead of classes.
422
+ This is useful to register parametrized en/decoders like PG::TextDecoder::Record .
423
+ - Add PG::BasicTypeMapForQueries#encode_array_as= to switch between various interpretations of ruby arrays.
424
+ - Add Time, Array<Time>, Array<BigDecimal> and Array<IPAddr> encoders to PG::BasicTypeMapForQueries
425
+ - Exchange sprintf based float encoder by very fast own implementation with more natural format. [#301](https://github.com/ged/ruby-pg/pull/301)
426
+ - Define encode and decode methods only in en/decoders that implement it, so that they can be queried by respond_to? .
427
+ - Improve PG::TypeMapByColumn#inspect
428
+ - Accept Integer and Float as input to TextEncoder::Numeric . [#310](https://github.com/ged/ruby-pg/pull/310)
429
+
430
+ Other enhancements:
431
+ - Allocate the data part and the ruby object of PG::Result in one step, so that we don't need to check for valid data.
432
+ This removes PG::Result.allocate and PG::Result.new, which were callable but without any practical use. [#42](https://github.com/ged/ruby-pg/pull/42)
433
+ - Make use of PQresultMemorySize() of PostgreSQL-12 and fall back to our internal estimator.
434
+ - Improve performance of PG::Result#stream_each_tuple .
435
+ - Store client encoding in data part of PG::Connection and PG::Result objects, so that we no longer use ruby's internal encoding bits. [#280](https://github.com/ged/ruby-pg/pull/280)
436
+ - Update Windows fat binary gem to OpenSSL-1.1.1d and PostgreSQL-12.1.
437
+ - Add support for TruffleRuby. It is regularly tested as part of our CI.
438
+ - Enable +frozen_string_literal+ in all pg's ruby files
439
+
440
+ Bugfixes:
441
+ - Update the license in gemspec to "BSD-2-Clause".
442
+ It was incorrectly labeled "BSD-3-Clause". [#40](https://github.com/ged/ruby-pg/pull/40)
443
+ - Respect PG::Coder#flags in PG::Coder#to_h.
444
+ - Fix PG::Result memsize reporting after #clear.
445
+ - Release field names to GC on PG::Result#clear.
446
+ - Fix double free in PG::Result#stream_each_tuple when an exception is raised in the block.
447
+ - Fix PG::Result#stream_each_tuple to deliver typemapped values.
448
+ - Fix encoding of Array<unknown> with PG::BasicTypeMapForQueries
449
+
450
+ Deprecated:
451
+ - Add a deprecation warning to PG::Connection#socket .
452
+
453
+ Removed:
454
+ - Remove PG::Connection#guess_result_memsize= which was temporary added in pg-1.1.
455
+ - Remove PG::Result.allocate and PG::Result.new (see enhancements).
456
+ - Remove support of tainted objects. [#307](https://github.com/ged/ruby-pg/pull/307)
457
+ - Remove support of ruby-2.0 and 2.1. Minimum is ruby-2.2 now.
458
+
459
+ Documentation:
460
+ - Update description of connection params. See PG::Connection.new
461
+ - Link many method descriptions to corresponding libpq's documentation.
462
+ - Update sync_* and async_* query method descriptions and document the aliases.
463
+ The primary documentation is now at the async_* methods which are the default since pg-1.1.
464
+ - Fix documentation of many constants
465
+
466
+
467
+ ## v1.1.4 [2019-01-08] Michael Granger <ged@FaerieMUD.org>
468
+
469
+ - Fix PG::BinaryDecoder::Timestamp on 32 bit systems. # 284
470
+ - Add new error-codes of PostgreSQL-11.
471
+ - Add ruby-2.6 support for Windows fat binary gems and remove ruby-2.0 and 2.1.
472
+
473
+
474
+ ## v1.1.3 [2018-09-06] Michael Granger <ged@FaerieMUD.org>
475
+
476
+ - Revert opimization that was sometimes causing EBADF in rb_wait_for_single_fd().
477
+
478
+
479
+ ## v1.1.2 [2018-08-28] Michael Granger <ged@FaerieMUD.org>
480
+
481
+ - Don't generate aliases for JOHAB encoding.
482
+ This avoids linking to deprecated/private function rb_enc(db)_alias().
483
+
484
+
485
+ ## v1.1.1 [2018-08-27] Michael Granger <ged@FaerieMUD.org>
486
+
487
+ - Reduce deprecation warnings to only one message per deprecation.
488
+
489
+
490
+ ## v1.1.0 [2018-08-24] Michael Granger <ged@FaerieMUD.org>
491
+
492
+ Deprecated (disable warnings per PG_SKIP_DEPRECATION_WARNING=1):
493
+ - Forwarding conn.exec to conn.exec_params is deprecated.
494
+ - Forwarding conn.exec_params to conn.exec is deprecated.
495
+ - Forwarding conn.async_exec to conn.async_exec_params.
496
+ - Forwarding conn.send_query to conn.send_query_params is deprecated.
497
+ - Forwarding conn.async_exec_params to conn.async_exec is deprecated.
498
+
499
+ PG::Connection enhancements:
500
+ - Provide PG::Connection#sync_* and PG::Connection#async_* query methods for explicit calling synchronous or asynchronous libpq API.
501
+ - Make PG::Connection#exec and siblings switchable between sync and async API per PG::Connection.async_api= and change the default to async flavors.
502
+ - Add async flavors of exec_params, prepare, exec_prepared, describe_prepared and describe_portal.
503
+ They are identical to their synchronous counterpart, but make use of PostgreSQL's async API.
504
+ - Replace `rb_thread_fd_select()` by faster `rb_wait_for_single_fd()` in `conn.block` and `conn.async_exec` .
505
+ - Add PG::Connection#discard_results .
506
+ - Raise an ArgumentError for strings containing zero bytes by #escape, #escape_literal, #escape_identifier, #quote_ident and PG::TextEncoder::Identifier. These methods previously truncated strings.
507
+
508
+ Result retrieval enhancements:
509
+ - Add PG::Result#tuple_values to retrieve all field values of a row as array.
510
+ - Add PG::Tuple, PG::Result#tuple and PG::Result#stream_each_tuple .
511
+ PG::Tuple offers a way to lazy cast result values.
512
+ - Estimate PG::Result size allocated by libpq and notify the garbage collector about it when running on Ruby-2.4 or newer.
513
+ - Make the estimated PG::Result size available to ObjectSpace.memsize_of(result) .
514
+
515
+ Type cast enhancements:
516
+ - Replace Ruby code by a faster C implementation of the SimpleDecoder's timestamp decode functions. github [#20](https://github.com/ged/ruby-pg/pull/20)
517
+ - Interpret years with up to 7 digists and BC dates by timestamp decoder.
518
+ - Add text timestamp decoders for UTC vs. local timezone variations.
519
+ - Add text timestamp encoders for UTC timezone.
520
+ - Add decoders for binary timestamps: PG::BinaryDecoder::Timestamp and variations.
521
+ - Add PG::Coder#flags accessor to allow modifications of de- respectively encoder behaviour.
522
+ - Add a flag to raise TypeError for invalid input values to PG::TextDecoder::Array .
523
+ - Add a text decoder for inet/cidr written in C.
524
+ - Add a numeric decoder written in C.
525
+ - Ensure input text is zero terminated for text format in PG::Coder#decode .
526
+
527
+ Source code enhancements:
528
+ - Fix headers and permission bits of various repository files.
529
+
530
+ Bugfixes:
531
+ - Properly decode array with prepended dimensions. [#272](https://github.com/ged/ruby-pg/pull/272)
532
+ For now dimension decorations are ignored, but a correct Array is returned.
533
+ - Array-Decoder: Avoid leaking memory when an Exception is raised while parsing. Fixes [#279](https://github.com/ged/ruby-pg/pull/279)
534
+
535
+
536
+ ## v1.0.0 [2018-01-10] Michael Granger <ged@FaerieMUD.org>
537
+
538
+ Deprecated:
539
+ - Deprecate Ruby older than 2.2.
540
+ - Deprecate Connection#socket in favor of #socket_io.
541
+
542
+ Removed:
543
+ - Remove compatibility code for Ruby < 2.0 and PostgreSQL < 9.2.
544
+ - Remove partial compatibility with Rubinius.
545
+ - Remove top-level constants PGconn, PGresult, and PGError.
546
+
547
+ Enhancements:
548
+ - Update error codes to PostgreSQL-10
549
+ - Update Windows binary gems to Ruby-2.5, PostgreSQL 10.1 and
550
+ OpenSSL 1.1.0g.
551
+
552
+ Bugfixes:
553
+ - Fix URI detection for connection strings. [#265](https://github.com/ged/ruby-pg/pull/265) (thanks to jjoos)
554
+ - MINGW: Workaround segfault due to GCC linker error in conjunction with MSVC.
555
+ This happens when linking to PostgreSQL-10.0-x64 from EnterpriseDB.
556
+
557
+ Documentation fixes:
558
+ - Add PostgreSQL version since when the given function is supported. [#263](https://github.com/ged/ruby-pg/pull/263)
559
+ - Better documentation to `encoder` and `decoder` arguments of COPY related methods.
560
+
561
+
562
+ ## v0.21.0 [2017-06-12] Michael Granger <ged@FaerieMUD.org>
563
+
564
+ Enhancements:
565
+ - Move add_dll_directory to the Runtime namespace for newest versions
566
+ of RubyInstaller.
567
+ - Deprecate PGconn, PGresult, and PGError top-level constants; a warning
568
+ will be output the first time one of them is used. They will be
569
+ removed in the upcoming 1.0 release.
570
+
571
+ Documentation fixes:
572
+ - Update the docs for PG::Result#cmd_tuples
573
+
574
+ New Samples:
575
+ - Add an example of the nicer #copy_data way of doing `COPY`.
576
+
577
+
578
+ ## v0.20.0 [2017-03-10] Michael Granger <ged@FaerieMUD.org>
579
+
580
+ Enhancements:
581
+ - Update error codes to PostgreSQL-9.6
582
+ - Update Windows binary gems to Ruby-2.4, PostgreSQL 9.6.1 and
583
+ OpenSSL 1.0.2j.
584
+ - Add support for RubyInstaller2 to Windows binary gems.
585
+
586
+ Bugfixes:
587
+ - Use secure JSON methods for JSON (de)serialisation. [#248](https://github.com/ged/ruby-pg/pull/248)
588
+ - Fix Result#inspect on a cleared result.
589
+ - Fix test case that failed on Ruby-2.4. [#255](https://github.com/ged/ruby-pg/pull/255)
590
+
591
+ Documentation fixes:
592
+ - Talk about Integer instead of Fixnum.
593
+ - Fix method signature of Coder#encode.
594
+
595
+
596
+ ## v0.19.0 [2016-09-21] Michael Granger <ged@FaerieMUD.org>
597
+
598
+ - Deprecate Ruby 1.9
599
+
600
+ Enhancements:
601
+ - Respect and convert character encoding of all strings sent
602
+ to the server. [#231](https://github.com/ged/ruby-pg/pull/231)
603
+ - Add PostgreSQL-9.5 functions PQsslInUse(), PQsslAttribute()
604
+ and PQsslAttributeNames().
605
+ - Various documentation fixes and improvements.
606
+ - Add mechanism to build without pg_config:
607
+ gem install pg -- --with-pg-config=ignore
608
+ - Update Windows binary gems to Ruby-2.3, PostgreSQL 9.5.4 and
609
+ OpenSSL 1.0.2f.
610
+ - Add JSON coders and add them to BasicTypeMapForResults and
611
+ BasicTypeMapBasedOnResult
612
+ - Allow build from git per bundler.
613
+
614
+ Bugfixes:
615
+ - Release GVL while calling PQsetClientEncoding(). [#245](https://github.com/ged/ruby-pg/pull/245)
616
+ - Add __EXTENSIONS__ to Solaris/SmartOS for Ruby >= 2.3.x. [#236](https://github.com/ged/ruby-pg/pull/236)
617
+ - Fix wrong exception when running SQL while in Connection#copy_data
618
+ block for output
619
+
620
+
621
+ ## v0.18.4 [2015-11-13] Michael Granger <ged@FaerieMUD.org>
622
+
623
+ Enhancements:
624
+ - Fixing compilation problems with Microsoft Visual Studio 2008. GH [#10](https://github.com/ged/ruby-pg/pull/10)
625
+ - Avoid name clash with xcode and jemalloc. PR[#22](https://github.com/ged/ruby-pg/pull/22), PR[#23](https://github.com/ged/ruby-pg/pull/23)
626
+
627
+ Bugfixes:
628
+ - Avoid segfault, when quote_ident or TextEncoder::Identifier
629
+ is called with Array containing non-strings. [#226](https://github.com/ged/ruby-pg/pull/226)
630
+
631
+
632
+ ## v0.18.3 [2015-09-03] Michael Granger <ged@FaerieMUD.org>
633
+
634
+ Enhancements:
635
+ - Use rake-compiler-dock to build windows gems easily.
636
+ - Add CI-tests on appveyor and fix test cases accordingly.
637
+
638
+ Bugfixes:
639
+ - Fix data type resulting in wrong base64 encoding.
640
+ - Change instance_of checks to kind_of for subclassing. [#220](https://github.com/ged/ruby-pg/pull/220)
641
+ - TextDecoder::Date returns an actual Ruby Date instead of a Time
642
+ (thanks to Thomas Ramfjord)
643
+
644
+
645
+ ## v0.18.2 [2015-05-14] Michael Granger <ged@FaerieMUD.org>
646
+
647
+ Enhancements:
648
+
649
+ - Allow URI connection string (thanks to Chris Bandy)
650
+ - Allow Array type parameter to conn.quote_ident
651
+
652
+ Bugfixes:
653
+
654
+ - Speedups and fixes for PG::TextDecoder::Identifier and quoting behavior
655
+ - Revert addition of PG::Connection#hostaddr [[#202](https://github.com/ged/ruby-pg/pull/202)].
656
+ - Fix decoding of fractional timezones and timestamps [[#203](https://github.com/ged/ruby-pg/pull/203)]
657
+ - Fixes for non-C99 compilers
658
+ - Avoid possible symbol name clash when linking against static libpq.
659
+
660
+
661
+ ## v0.18.1 [2015-01-05] Michael Granger <ged@FaerieMUD.org>
662
+
663
+ Correct the minimum compatible Ruby version to 1.9.3. [#199](https://github.com/ged/ruby-pg/pull/199)
664
+
665
+
666
+ ## v0.18.0 [2015-01-01] Michael Granger <ged@FaerieMUD.org>
667
+
668
+ Bugfixes:
669
+ - Fix OID to Integer mapping (it is unsigned now). [#187](https://github.com/ged/ruby-pg/pull/187)
670
+ - Fix possible segfault in conjunction with notice receiver. [#185](https://github.com/ged/ruby-pg/pull/185)
671
+
672
+ Enhancements:
673
+
674
+ - Add an extensible type cast system.
675
+ - A lot of performance improvements.
676
+ - Return frozen String objects for result field names.
677
+ - Add PG::Result#stream_each and #stream_each_row as fast helpers for
678
+ the single row mode.
679
+ - Add Enumerator variant to PG::Result#each and #each_row.
680
+ - Add PG::Connection#conninfo and #hostaddr.
681
+ - Add PG.init_openssl and PG.init_ssl methods.
682
+ - Add PG::Result.inspect
683
+ - Force zero termination for all text strings that are given to libpq.
684
+ It raises an ArgumentError if the string contains a null byte.
685
+ - Update Windows cross build to PostgreSQL 9.3.
686
+
687
+
688
+
689
+ ## v0.17.1 [2013-12-18] Michael Granger <ged@FaerieMUD.org>
690
+
691
+ Bugfixes:
692
+
693
+ - Fix compatibility with signal handlers defined in Ruby. This reverts
694
+ cancellation of queries running on top of the blocking libpq API (like
695
+ Connection#exec) in case of signals. As an alternative the #async_exec
696
+ can be used, which is reverted to use the non-blocking API, again.
697
+ - Wrap PQcancel to be called without GVL. It internally waits for
698
+ the canceling connection.
699
+
700
+ Documentation fixes:
701
+
702
+ - Fix documentation for PG::Connection::conndefaults.
703
+
704
+
705
+ ## v0.17.0 [2013-09-15] Michael Granger <ged@FaerieMUD.org>
706
+
707
+ Bugfixes:
708
+
709
+ - Fix crash by calling PQsend* and PQisBusy without GVL ([#171](https://github.com/ged/ruby-pg/pull/171)).
710
+
711
+ Enhancements:
712
+
713
+ - Add method PG::Connection#copy_data.
714
+ - Add a Gemfile to allow installation of dependencies with bundler.
715
+ - Add compatibility with rake-compiler-dev-box.
716
+ - Return self from PG::Result#check instead of nil. This allows
717
+ to stack method calls.
718
+
719
+
720
+ ## v0.16.0 [2013-07-22] Michael Granger <ged@FaerieMUD.org>
721
+
722
+ Bugfixes:
723
+
724
+ - Avoid warnings about uninitialized instance variables.
725
+ - Use a more standard method of adding library and include directories.
726
+ This fixes build on AIX (Github [#7](https://github.com/ged/ruby-pg/pull/7)) and Solaris ([#164](https://github.com/ged/ruby-pg/pull/164)).
727
+ - Cancel the running query, if a thread is about to be killed (e.g. by CTRL-C).
728
+ - Fix GVL issue with wait_for_notify/notifies and notice callbacks.
729
+ - Set proper encoding on the string returned by quote_ident, escape_literal
730
+ and escape_identifier ([#163](https://github.com/ged/ruby-pg/pull/163)).
731
+ - Use nil as PG::Error#result in case of a NULL-result from libpq ([#166](https://github.com/ged/ruby-pg/pull/166)).
732
+ - Recalculate the timeout of conn#wait_for_notify and conn#block in case
733
+ of socket events that require re-runs of select().
734
+
735
+ Documentation fixes:
736
+
737
+ - Fix non working example for PGresult#error_field.
738
+
739
+ Enhancements:
740
+
741
+ - Add unique exception classes for each PostgreSQL error type ([#5](https://github.com/ged/ruby-pg/pull/5)).
742
+ - Return result of the block in conn#transaction instead of nil ([#158](https://github.com/ged/ruby-pg/pull/158)).
743
+ - Allow 'rake compile' and 'rake gem' on non mercurial repos.
744
+ - Add support for PG_DIAG_*_NAME error fields of PostgreSQL-9.3 ([#161](https://github.com/ged/ruby-pg/pull/161)).
745
+
746
+
747
+ ## v0.15.1 [2013-04-08] Michael Granger <ged@FaerieMUD.org>
748
+
749
+ Bugfixes:
750
+
751
+ - Shorten application_name to avoid warnings about truncated identifier.
752
+
753
+
754
+ ## v0.15.0 [2013-03-03] Michael Granger <ged@FaerieMUD.org>
755
+
756
+ Bugfixes:
757
+
758
+ - Fix segfault in PG::Result#field_values when called with non String value.
759
+ - Fix encoding of messages delivered by notice callbacks.
760
+ - Fix text encoding for Connection#wait_for_notify and Connection#notifies.
761
+ - Fix 'Bad file descriptor' problems under Windows: wrong behaviour of
762
+ #wait_for_notify() and timeout handling of #block on Ruby 1.9.
763
+
764
+ Documentation fixes:
765
+
766
+ - conn#socket() can not be used with IO.for_fd() on Windows.
767
+
768
+ Enhancements:
769
+
770
+ - Tested under Ruby 2.0.0p0.
771
+ - Add single row mode of PostgreSQL 9.2.
772
+ - Set fallback_application_name to program name $0. Thanks to Will Leinweber
773
+ for the patch.
774
+ - Release Ruby's GVL while calls to blocking libpq functions to allow better
775
+ concurrency in threaded applications.
776
+ - Refactor different variants of waiting for the connection socket.
777
+ - Make use of rb_thread_fd_select() on Ruby 1.9 and avoid deprecated
778
+ rb_thread_select().
779
+ - Add an example of how to insert array data using a prepared statement ([#145](https://github.com/ged/ruby-pg/pull/145)).
780
+ - Add continuous integration tests on travis-ci.org.
781
+ - Add PG::Result#each_row for iterative over result sets by row. Thanks to
782
+ Aaron Patterson for the patch.
783
+ - Add a PG::Connection#socket_io method for fetching a (non-autoclosing) IO
784
+ object for the connection's socket.
785
+
786
+ Specs:
787
+
788
+ - Fix various specs to run on older PostgreSQL and Ruby versions.
789
+ - Avoid fork() in specs to allow usage on Windows and JRuby.
790
+
791
+
792
+ ## v0.14.1 [2012-09-02] Michael Granger <ged@FaerieMUD.org>
793
+
794
+ Important bugfix:
795
+
796
+ - Fix stack overflow bug in PG::Result#values and #column_values ([#135](https://github.com/ged/ruby-pg/pull/135)). Thanks
797
+ to everyone who reported the bug, and Lars Kanis especially for figuring out
798
+ the problem.
799
+
800
+ PostgreSQL 9.2 beta fixes:
801
+
802
+ - Recognize PGRES_SINGLE_TUPLE as OK when checking PGresult (Jeremy Evans)
803
+
804
+ Documentation fixes:
805
+
806
+ - Add note about the usage scope of the result object received by the
807
+ #set_notice_receiver block. (Lars Kanis)
808
+ - Add PGRES_COPY_BOTH to documentation of PG::Result#result_status. (Lars Kanis)
809
+ - Add some documentation to PG::Result#fnumber (fix for [#139](https://github.com/ged/ruby-pg/pull/139))
810
+
811
+
812
+ ## v0.14.0 [2012-06-17] Michael Granger <ged@FaerieMUD.org>
813
+
814
+ Bugfixes:
815
+ [#47](https://github.com/ged/ruby-pg/pull/47), [#104](https://github.com/ged/ruby-pg/pull/104)
816
+
817
+
818
+ New Methods for PostgreSQL 9 and async API support:
819
+ PG
820
+ - ::library_version
821
+
822
+ PG::Connection
823
+ - ::ping
824
+ - #escape_literal
825
+ - #escape_identifier
826
+ - #set_default_encoding
827
+
828
+ PG::Result
829
+ - #check
830
+
831
+
832
+ New Samples:
833
+
834
+ This release also comes with a collection of contributed sample scripts for
835
+ doing resource-utilization reports, graphing database statistics,
836
+ monitoring for replication lag, shipping WAL files for replication,
837
+ automated tablespace partitioning, etc. See the samples/ directory.
838
+
839
+
840
+ ## v0.13.2 [2012-02-22] Michael Granger <ged@FaerieMUD.org>
841
+
842
+ - Make builds against PostgreSQL earlier than 8.3 fail with a descriptive
843
+ message instead of a compile failure.
844
+
845
+
846
+ ## v0.13.1 [2012-02-12] Michael Granger <ged@FaerieMUD.org>
847
+
848
+ - Made use of a finished PG::Connection raise a PG::Error instead of
849
+ a fatal error ([#110](https://github.com/ged/ruby-pg/pull/110)).
850
+ - Added missing BSDL license file ([#108](https://github.com/ged/ruby-pg/pull/108))
851
+
852
+
853
+ ## v0.13.0 [2012-02-09] Michael Granger <ged@FaerieMUD.org>
854
+
855
+ Reorganization of modules/classes to be better Ruby citizens (with backward-compatible aliases):
856
+ - Created toplevel namespace 'PG' to correspond with the gem name.
857
+ - Renamed PGconn to PG::Connection (with ::PGconn alias)
858
+ - Renamed PGresult to PG::Result (with ::PGresult alias)
859
+ - Renamed PGError to PG::Error (with ::PGError alias)
860
+ - Declare all constants inside PG::Constants, then include them in
861
+ PG::Connection and PG::Result for backward-compatibility, and
862
+ in PG for convenience.
863
+ - Split the extension source up by class/module.
864
+ - Removed old compatibility code for PostgreSQL versions < 8.3
865
+
866
+ Documentation:
867
+ - Clarified licensing, updated to Ruby 1.9's license.
868
+ - Merged authors list, added some missing people to the Contributor's
869
+ list.
870
+ - Cleaned up the sample/ directory
871
+ - Making contact info a bit clearer, link to the Google+ page and
872
+ the mailing list
873
+
874
+ Enhancements:
875
+ - Added a convenience method: PG.connect -> PG::Connection.new
876
+
877
+ Bugfixes:
878
+ - Fixed LATIN5-LATIN10 Postgres<->Ruby encoding conversions
879
+
880
+
881
+
882
+ ## v0.12.2 [2012-01-03] Michael Granger <ged@FaerieMUD.org>
883
+
884
+ - Fix for the 1.8.7 breakage introduced by the st.h fix for alternative Ruby
885
+ implementations ([#97](https://github.com/ged/ruby-pg/pull/97) and [#98](https://github.com/ged/ruby-pg/pull/98)). Thanks to Lars Kanis for the patch.
886
+ - Encode error messages with the connection's encoding under 1.9 ([#96](https://github.com/ged/ruby-pg/pull/96))
887
+
888
+
889
+ ## v0.12.1 [2011-12-14] Michael Granger <ged@FaerieMUD.org>
890
+
891
+ - Made rake-compiler a dev dependency, as Rubygems doesn't use the Rakefile
892
+ for compiling the extension. Thanks to eolamey@bitbucket and Jeremy Evans
893
+ for pointing this out.
894
+ - Added an explicit include for ruby/st.h for implementations that need it
895
+ (fixes [#95](https://github.com/ged/ruby-pg/pull/95)).
896
+
897
+
898
+ ## v0.12.0 [2011-12-07] Michael Granger <ged@FaerieMUD.org>
899
+
900
+ - PGconn#wait_for_notify
901
+ * send nil as the payload argument if the NOTIFY didn't have one.
902
+ * accept a nil argument for no timeout (Sequel support)
903
+ * Fixed API docs
904
+ * Taint and encode event name and payload
905
+ - Handle errors while rb_thread_select()ing in PGconn#block.
906
+ (Brian Weaver).
907
+ - Fixes for Win32 async queries (Rafał Bigaj)
908
+ - Memory leak fixed: Closing opened WSA event. (rafal)
909
+ - Fixes for [#66](https://github.com/ged/ruby-pg/pull/66) Win32 asynchronous queries hang on connection
910
+ error. (rafal)
911
+ - Fixed a typo in PGconn#error_message's documentation
912
+ - fixing unused variable warnings for ruby 1.9.3 (Aaron Patterson)
913
+ - Build system bugfixes
914
+ - Converted to Hoe
915
+ - Updates for the Win32 binary gem builds (Lars Kanis)
916
+
917
+
918
+ ## v0.11.0 [2011-02-09] Michael Granger <ged@FaerieMUD.org>
919
+
920
+ Enhancements:
921
+
922
+ * Added a PGresult#values method to fetch all result rows as an Array of
923
+ Arrays. Thanks to Jason Yanowitz (JYanowitz at enovafinancial dot com) for
924
+ the patch.
925
+
926
+
927
+ ## v0.10.1 [2011-01-19] Michael Granger <ged@FaerieMUD.org>
928
+
929
+ Bugfixes:
930
+
931
+ * Add an include guard for pg.h
932
+ * Simplify the common case require of the ext
933
+ * Include the extconf header
934
+ * Fix compatibility with versions of PostgreSQL without PQgetCancel. (fixes [#36](https://github.com/ged/ruby-pg/pull/36))
935
+ * Fix require for natively-compiled extension under Windows. (fixes [#55](https://github.com/ged/ruby-pg/pull/55))
936
+ * Change rb_yield_splat() to rb_yield_values() for compatibility with Rubinius. (fixes [#54](https://github.com/ged/ruby-pg/pull/54))
937
+
938
+
939
+ ## v0.10.0 [2010-12-01] Michael Granger <ged@FaerieMUD.org>
940
+
941
+ Enhancements:
942
+
943
+ * Added support for the payload of NOTIFY events (w/Mahlon E. Smith)
944
+ * Updated the build system with Rubygems suggestions from RubyConf 2010
945
+
946
+ Bugfixes:
947
+
948
+ * Fixed issue with PGconn#wait_for_notify that caused it to miss notifications that happened after
949
+ the LISTEN but before the wait_for_notify.
950
+
951
+ ## v0.9.0 [2010-02-28] Michael Granger <ged@FaerieMUD.org>
952
+
953
+ Bugfixes.
954
+
955
+ ## v0.8.0 [2009-03-28] Jeff Davis <davis.jeffrey@gmail.com>
956
+
957
+ Bugfixes, better Windows support.
958
+